From 952eddef9aff85b1e92626e89baaf7a360e2ac85 Mon Sep 17 00:00:00 2001 From: dim <dim@FreeBSD.org> Date: Sun, 22 Dec 2013 00:07:40 +0000 Subject: Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3): https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841 --- .../cxx0x-initializer-stdinitializerlist.cpp | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp') 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')}} +} -- cgit v1.1