aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/vla2.C
blob: 6aa5fcfe955d4567ac2cd1b99c3b2b7a40b44e19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// N3639 allows initialization and capture of VLAs
// { dg-do run { target c++1y } }

void f(int n)
{
  int ar[n] = { 42 };
  auto l = [&] { return ar[0]; };
  if (l() != 42) __builtin_abort ();
}

int main()
{
  f(1);
}