comparison gcc/testsuite/g++.dg/cpp2a/lambda-pack-init2.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 // PR c++/89686
2 // { dg-do compile { target c++2a } }
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 }