aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/decomp62.C
blob: b0ce10570c72358c9044a225b40e24c7bf3a5050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// PR c++/90321
// { dg-do compile { target c++17 } }

template<class F> struct hack : F { };
template<class F> hack(F) -> hack<F>;

int main()
{
    auto f = [x = 1, y = 2]() { };
    auto [a, b] = hack { f };  // { dg-error "cannot decompose lambda closure type" }
    return b;
}