diff options
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index fe3cd8fc3a1..bfe3f7991ea 100644 --- a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -122,3 +122,8 @@ void auto_deduction() { for (int i : {1, 2, 3, 4}) {} } + +void dangle() { + new auto{1, 2, 3}; // expected-error {{cannot use list-initialization}} + new std::initializer_list<int>{1, 2, 3}; // expected-warning {{at the end of the full-expression}} +} |