diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-30 22:26:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-30 22:26:29 +0000 |
commit | d42a0fb41bee91ff78eb330b8e201d28744a0856 (patch) | |
tree | 7e339f4415bcd3d0910160b12b10df660ea78339 /clang/test/SemaCXX/dcl_init_aggr.cpp | |
parent | c40931856201822e36e0d8a4cc9ade526315b803 (diff) | |
download | bcm5719-llvm-d42a0fb41bee91ff78eb330b8e201d28744a0856.tar.gz bcm5719-llvm-d42a0fb41bee91ff78eb330b8e201d28744a0856.zip |
Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.
llvm-svn: 63435
Diffstat (limited to 'clang/test/SemaCXX/dcl_init_aggr.cpp')
-rw-r--r-- | clang/test/SemaCXX/dcl_init_aggr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/dcl_init_aggr.cpp b/clang/test/SemaCXX/dcl_init_aggr.cpp index d8a41805365..41032271062 100644 --- a/clang/test/SemaCXX/dcl_init_aggr.cpp +++ b/clang/test/SemaCXX/dcl_init_aggr.cpp @@ -34,7 +34,7 @@ struct StaticMemberTest { } smt = { 1, &smt.i }; // C++ [dcl.init.aggr]p6 -char cv[4] = { 'a', 's', 'd', 'f', 0 }; // expected-warning{{excess elements in array initializer}} +char cv[4] = { 'a', 's', 'd', 'f', 0 }; // expected-error{{excess elements in array initializer}} // C++ [dcl.init.aggr]p7 struct TooFew { int a; char* b; int c; }; @@ -103,5 +103,5 @@ union u { int a; char* b; }; u u1 = { 1 }; u u2 = u1; u u3 = 1; // expected-error{{cannot initialize 'u3' with an rvalue of type 'int'}} -u u4 = { 0, "asdf" }; // expected-warning{{excess elements in array initializer}} +u u4 = { 0, "asdf" }; // expected-error{{excess elements in array initializer}} u u5 = { "asdf" }; // expected-error{{incompatible type initializing 'char const [5]', expected 'int'}} |