| 1 |
// PR c++/89686 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
|
| 4 |
template <typename... Ts> |
| 5 |
void foo(Ts... xs) |
| 6 |
{ |
| 7 |
int i = 10; |
| 8 |
[...xs...]{}(); // { dg-error "4:too many ..... in lambda capture" } |
| 9 |
[...xs...=xs]{}(); // { dg-error "9:too many ..... in lambda capture|expected" } |
| 10 |
[xs...]{}(); |
| 11 |
[...xs=xs]{}(); |
| 12 |
|
| 13 |
[i, ...xs...]{}(); // { dg-error "7:too many ..... in lambda capture" } |
| 14 |
[i, ...xs...=xs]{}(); // { dg-error "12:too many ..... in lambda capture|expected" } |
| 15 |
[i, xs...]{}(); |
| 16 |
[i, ...xs=xs]{}(); |
| 17 |
} |
| 18 |
|
| 19 |
int main() |
| 20 |
{ |
| 21 |
foo(0, 1, 2); |
| 22 |
} |