summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/cxx0x-initializer-scalars.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
committerdim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
commit3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch)
treedbbd4047878da71c1a706e26ce05b4e7791b14cc /test/SemaCXX/cxx0x-initializer-scalars.cpp
parent38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff)
downloadFreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip
FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-scalars.cpp')
-rw-r--r--test/SemaCXX/cxx0x-initializer-scalars.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-scalars.cpp b/test/SemaCXX/cxx0x-initializer-scalars.cpp
index 1475dcf..c9d5ffd 100644
--- a/test/SemaCXX/cxx0x-initializer-scalars.cpp
+++ b/test/SemaCXX/cxx0x-initializer-scalars.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s -pedantic-errors
struct one { char c[1]; };
struct two { char c[2]; };
@@ -55,7 +55,7 @@ namespace integral {
int ar[10];
(void) ar[{1}]; // expected-error {{array subscript is not an integer}}
- return {1};
+ return {1}; // expected-warning {{braces around scalar init}}
}
void inline_init() {
@@ -70,15 +70,15 @@ namespace integral {
void function_call() {
void takes_int(int);
- takes_int({1});
+ takes_int({1}); // expected-warning {{braces around scalar init}}
}
void overloaded_call() {
one overloaded(int);
two overloaded(double);
- static_assert(sizeof(overloaded({0})) == sizeof(one), "bad overload");
- static_assert(sizeof(overloaded({0.0})) == sizeof(two), "bad overload");
+ static_assert(sizeof(overloaded({0})) == sizeof(one), "bad overload"); // expected-warning {{braces around scalar init}}
+ static_assert(sizeof(overloaded({0.0})) == sizeof(two), "bad overload"); // expected-warning {{braces around scalar init}}
void ambiguous(int, double); // expected-note {{candidate}}
void ambiguous(double, int); // expected-note {{candidate}}
OpenPOWER on IntegriCloud