Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / cpp1y / lambda-init6.C
blob2b82bca457834a6092fed38b9b6a232336346f9e
1 // Test that simple captures are not named in the closure type, but
2 // initialized captures are named.
3 // { dg-do compile { target c++1y } }
5 int main()
7   int i;
8   auto lam = [i,j=42]{};
9   lam.j;
10   lam.j.foo;                    // { dg-error "::j" }
11   lam.i;                        // { dg-error "no member" }