diff options
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm | 19 | ||||
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp | 4 |
2 files changed, 20 insertions, 3 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm index 6a6e0d9c90..0db2bf5646 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm @@ -89,6 +89,8 @@ namespace overloading { namespace PR13117 { struct A { + template<typename ... Args> static void f(Args...); + template<typename ... Args> static void f1() { (void)^(Args args) { // expected-error{{block contains unexpanded parameter pack 'Args'}} @@ -97,9 +99,24 @@ namespace PR13117 { template<typename ... Args> static void f2() { - (void)[](Args args) { // expected-error{{lambda contains unexpanded parameter pack 'Args'}} + // FIXME: Allow this. + f( + ^(Args args) // expected-error{{block contains unexpanded parameter pack 'Args'}} + { } + ... // expected-error{{pack expansion does not contain any unexpanded parameter packs}} + ); + } + + template<typename ... Args> static void f3() + { + (void)[](Args args) { // expected-error{{expression contains unexpanded parameter pack 'Args'}} }; } + + template<typename ... Args> static void f4() + { + f([](Args args) { } ...); + } }; void g() { diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp index 174db257c8..82fc04a48f 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp @@ -9,8 +9,8 @@ void print(T first, Ts... rest) { } template<typename... Ts> -void unsupported(Ts ...values) { - auto unsup = [values] {}; // expected-error{{unexpanded function parameter pack capture is unsupported}} +void unexpanded_capture(Ts ...values) { + auto unexp = [values] {}; // expected-error{{initializer contains unexpanded parameter pack 'values'}} } template<typename... Ts> |