diff options
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-aggregates.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-aggregates.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-aggregates.cpp b/test/SemaCXX/cxx0x-initializer-aggregates.cpp index 48888d0eb0..801a82f570 100644 --- a/test/SemaCXX/cxx0x-initializer-aggregates.cpp +++ b/test/SemaCXX/cxx0x-initializer-aggregates.cpp @@ -73,3 +73,17 @@ namespace aggregate { struct C { int a[2]; C():a({1, 2}) { } }; // expected-error {{parenthesized initialization of a member array is a GNU extension}} } + +namespace array_explicit_conversion { + typedef int test1[2]; + typedef int test2[]; + template<int x> struct A { int a[x]; }; // expected-error {{'a' declared as an array with a negative size}} + typedef A<1> test3[]; + typedef A<-1> test4[]; + void f() { + (void)test1{1}; + (void)test2{1}; + (void)test3{{{1}}}; + (void)test4{{{1}}}; // expected-note {{in instantiation of template class 'array_explicit_conversion::A<-1>' requested here}} + } +} |