summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-02-11 02:41:33 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-02-11 02:41:33 +0000
commit215f423ff22981327e56769150496a9000c2ba53 (patch)
tree74d57be6db8bb4c77e12e30524fa16931a36e4ca /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
parent560558eb7c1deee76a1adb941e001e074dba460d (diff)
downloadbcm5719-llvm-215f423ff22981327e56769150496a9000c2ba53.tar.gz
bcm5719-llvm-215f423ff22981327e56769150496a9000c2ba53.zip
Add a warning for direct-list-initialization of a variable with a deduced type
(or of a lambda init-capture, which is sort-of such a variable). The semantics of such constructs will change when we implement N3922, so we intend to warn on this in Clang 3.6 then change the semantics in Clang 3.7. llvm-svn: 228792
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp')
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
index 6be200dd54e..1228c74b070 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
@@ -48,7 +48,7 @@ auto bad_init_2 = [a(1, 2)] {}; // expected-error {{initializer for lambda captu
auto bad_init_3 = [&a(void_fn())] {}; // expected-error {{cannot form a reference to 'void'}}
auto bad_init_4 = [a(void_fn())] {}; // expected-error {{has incomplete type 'void'}}
auto bad_init_5 = [a(overload_fn)] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer of type '<overloaded function}}
-auto bad_init_6 = [a{overload_fn}] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer list}}
+auto bad_init_6 = [a{overload_fn}] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer list}} expected-warning {{will change meaning in a future version of Clang}}
template<typename...T> void pack_1(T...t) { (void)[a(t...)] {}; } // expected-error {{initializer missing for lambda capture 'a'}}
template void pack_1<>(); // expected-note {{instantiation of}}
@@ -61,7 +61,7 @@ auto a = [a(4), b = 5, &c = static_cast<const int&&>(0)] {
using T = decltype(c);
using T = const int &;
};
-auto b = [a{0}] {}; // expected-error {{include <initializer_list>}}
+auto b = [a{0}] {}; // expected-error {{include <initializer_list>}} expected-warning {{will change meaning in a future version of Clang}}
struct S { S(); S(S&&); };
template<typename T> struct remove_reference { typedef T type; };
OpenPOWER on IntegriCloud