diff options
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm | 38 |
1 files changed, 38 insertions, 0 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 0c3fdb2..0db2bf5 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm @@ -86,3 +86,41 @@ namespace overloading { int &ir = accept_lambda_conv([](int x) { return x + 1; }); } } + +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'}} + }; + } + + template<typename ... Args> static void f2() + { + // 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() { + A::f1<int, int>(); + A::f2<int, int>(); + } +} |