gcc/testsuite/g++.dg/cpp1z/decomp60.C
raw| 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 |