summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1y/vla2.C
blob: 07c300884a37ef43ab248dbed22a3a4d1b0c813e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// N3639 allows initialization and capture of VLAs
// { dg-do run { target c++11 } }
// { dg-options "-Wno-vla" }

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

int main()
{
  f(1);
}