| 1 |
// PR c++/90321 |
| 2 |
// { dg-do compile { target c++17 } } |
| 3 |
|
| 4 |
template<class F> struct hack : F { }; |
| 5 |
template<class F> hack(F) -> hack<F>; |
| 6 |
|
| 7 |
int main() |
| 8 |
{ |
| 9 |
auto f = [x = 1, y = 2]() { }; |
| 10 |
auto [a, b] = hack { f }; // { dg-error "cannot decompose lambda closure type" } |
| 11 |
return b; |
| 12 |
} |