aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/lambda-init6.C
blob: 2b82bca457834a6092fed38b9b6a232336346f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Test that simple captures are not named in the closure type, but
// initialized captures are named.
// { dg-do compile { target c++1y } }

int main()
{
  int i;
  auto lam = [i,j=42]{};
  lam.j;
  lam.j.foo;			// { dg-error "::j" }
  lam.i;			// { dg-error "no member" }
}