diff options
Diffstat (limited to 'clang/test/SemaCXX/lambda-expressions.cpp')
-rw-r--r-- | clang/test/SemaCXX/lambda-expressions.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/clang/test/SemaCXX/lambda-expressions.cpp b/clang/test/SemaCXX/lambda-expressions.cpp index 8ea8e32..f9d7cfc 100644 --- a/clang/test/SemaCXX/lambda-expressions.cpp +++ b/clang/test/SemaCXX/lambda-expressions.cpp @@ -149,7 +149,8 @@ namespace PR12031 { void f(int i, X x); void g() { const int v = 10; - f(v, [](){}); + f(v, [](){}); // cxx03-warning {{template argument uses local type}} \ + // cxx03-note {{while substituting}} } } @@ -572,26 +573,37 @@ namespace PR27994 { struct A { template <class T> A(T); }; template <class T> -struct B { +struct B { // #PR27994_B int x; - A a = [&] { int y = x; }; - A b = [&] { [&] { [&] { int y = x; }; }; }; - A d = [&](auto param) { int y = x; }; // cxx03-cxx11-error {{'auto' not allowed in lambda parameter}} - A e = [&](auto param) { [&] { [&](auto param2) { int y = x; }; }; }; // cxx03-cxx11-error 2 {{'auto' not allowed in lambda parameter}} + A a = [&] { int y = x; }; // cxx03-warning {{template argument uses unnamed type}} \ + // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}} + A b = [&] { [&] { [&] { int y = x; }; }; }; // cxx03-warning {{template argument uses unnamed type}} \ + // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}} + A d = [&](auto param) { int y = x; }; // cxx03-cxx11-error {{'auto' not allowed in lambda parameter}} \ + // cxx03-warning {{template argument uses unnamed type}} \ + // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}} + A e = [&](auto param) { [&] { [&](auto param2) { int y = x; }; }; }; // cxx03-cxx11-error 2 {{'auto' not allowed in lambda parameter}} \ + // cxx03-warning {{template argument uses unnamed type}} \ + // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}} }; B<int> b; +// cxx03-note@#PR27994_B 4{{in instantiation of default member initializer}} +// cxx03-note@-2 4{{in evaluation of exception}} template <class T> struct C { struct D { + // cxx03-note@-1 {{in instantiation of default member initializer}} int x; - A f = [&] { int y = x; }; + A f = [&] { int y = x; }; // cxx03-warning {{template argument uses unnamed type}} \ + // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}} }; }; int func() { C<int> a; decltype(a)::D b; + // cxx03-note@-1 {{in evaluation of exception}} } } @@ -606,8 +618,12 @@ struct S1 { void foo1() { auto s0 = S1([name=]() {}); // expected-error {{expected expression}} + // cxx03-warning@-1 {{template argument uses local type}} \ + // cxx03-note@-1 {{while substituting deduced template arguments}} auto s1 = S1([name=name]() {}); // expected-error {{use of undeclared identifier 'name'; did you mean 'name1'?}} // cxx03-cxx11-warning@-1 {{initialized lambda captures are a C++14 extension}} + // cxx03-warning@-2 {{template argument uses local type}} \ + // cxx03-note@-2 {{while substituting deduced template arguments}} } } |