gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic11.C
raw| 1 | // PR c++/97358 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template <typename... T> void foo (T... x) {} |
| 5 | |
| 6 | template <typename... T> void bar (T... x) |
| 7 | { |
| 8 | foo ([x...] { return x; }...); // { dg-error "not expanded|no parameter packs" } |
| 9 | #if __cpp_init_captures >= 201803L |
| 10 | foo ([...y = x] { return y; }...); // { dg-error "not expanded|no parameter packs" "" { target c++20 } } |
| 11 | #endif |
| 12 | } |
| 13 | |
| 14 | void |
| 15 | test () |
| 16 | { |
| 17 | bar (); |
| 18 | bar (1); |
| 19 | bar (2.0, 3LL, 4); |
| 20 | } |