gcc/testsuite/g++.dg/cpp1z/decomp24.C
raw| 1 | // PR c++/78896 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "" } |
| 4 | |
| 5 | int |
| 6 | foo () |
| 7 | { |
| 8 | int a {10}; |
| 9 | auto [b] { [&a](){} }; // { dg-error "cannot decompose lambda closure type" } |
| 10 | return b - a; // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 } |
| 11 | } |