diff options
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-aggregates.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-aggregates.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-aggregates.cpp b/test/SemaCXX/cxx0x-initializer-aggregates.cpp index c83058a..f53ac6d 100644 --- a/test/SemaCXX/cxx0x-initializer-aggregates.cpp +++ b/test/SemaCXX/cxx0x-initializer-aggregates.cpp @@ -115,4 +115,18 @@ namespace sub_constructor { Aggr invalid { {} , {&ok1} , {0,0} }; // expected-error {{no matching constructor for initialization}} NoDefaultConstructor2 array_ok[] = { {0,0} , {0,1} }; NoDefaultConstructor2 array_error[] = { {0,0} , {0} }; // expected-error {{no matching constructor for initialization}} -}
\ No newline at end of file +} + +namespace multidimensional_array { + void g(const int (&)[2][2]) {} + void g(const int (&)[2][2][2]) = delete; + + void h() { + g({{1,2},{3,4}}); + } +} + +namespace array_addressof { + using T = int[5]; + T *p = &T{1,2,3,4,5}; // expected-error {{taking the address of a temporary object of type 'T' (aka 'int [5]')}} +} |