diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | 952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | |
parent | ea266cad53e3d49771fa38103913d3ec7a166694 (diff) | |
download | FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz |
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index 88571d6..9d89cce 100644 --- a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -144,7 +144,7 @@ namespace PR12119 { template<typename T> void g(std::initializer_list<std::initializer_list<T>>); void foo() { - f({0, {1}}); + f({0, {1}}); // expected-warning{{braces around scalar initializer}} g({{0, 1}, {2, 3}}); std::initializer_list<int> il = {1, 2}; g({il, {2, 3}}); @@ -208,3 +208,25 @@ 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}} +} + +namespace RefVersusInitList { + struct S {}; + void f(const S &) = delete; + void f(std::initializer_list<S>); + void g(S s) { f({S()}); } +} + +namespace PR18013 { + int f(); + std::initializer_list<long (*)()> x = {f}; // expected-error {{cannot initialize an array element of type 'long (*const)()' with an lvalue of type 'int ()': different return type ('long' vs 'int')}} +} |