]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/cpp1z/decomp60.C
c++: lambda capturing structured bindings [PR85889]
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cpp1z / decomp60.C
1 // PR c++/85889
2 // { dg-do compile { target c++17 } }
3 // { dg-options "" }
4
5 struct X { int i, j; };
6 void f() {
7 X x{};
8 auto [i, j] = x;
9 [&i]() { }; // { dg-warning "captured structured bindings" "" { target c++17_only } }
10 [i]() { }; // { dg-warning "captured structured bindings" "" { target c++17_only } }
11 }
12