diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-23 23:20:04 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-23 23:20:04 +0000 |
commit | cd09065ec399e21132c00d4d5efb54fdf4481740 (patch) | |
tree | bf2ccc87e76de89cbbe7fa7a3da71385b83d27f8 /clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | |
parent | 48143175160033fa388a7bf612a7aae86d9aeef7 (diff) | |
download | bcm5719-llvm-cd09065ec399e21132c00d4d5efb54fdf4481740.tar.gz bcm5719-llvm-cd09065ec399e21132c00d4d5efb54fdf4481740.zip |
Fix crash-on-invalid if list-initialization works, but we bail out when
building the resulting expression because it invokes a deleted constructor.
llvm-svn: 182624
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index 88571d671b0..0f7eb77c864 100644 --- a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -208,3 +208,13 @@ namespace init_list_deduction_failure { void h() { g({f}); } // expected-error@-1 {{no matching function for call to 'g'}} } + +namespace deleted_copy { + struct X { + X(int i) {} + X(const X& x) = delete; // expected-note {{here}} + void operator=(const X& x) = delete; + }; + + std::initializer_list<X> x{1}; // expected-error {{invokes deleted constructor}} +} |