fortran/openmp.cc: Fix var init and locus use to avoid uninit values [PR fortran...
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / vla2.C
blob010b54cd41c6379aa20c514d27eb3f9ab2d31016
1 // N3639 allows initialization and capture of VLAs
2 // { dg-do run { target c++11 } }
3 // { dg-options "-Wno-vla" }
4 // { dg-require-effective-target alloca }
6 void f(int n)
8   int ar[n] = { 42 };
9   auto l = [&] { return ar[0]; };
10   if (l() != 42) __builtin_abort ();
13 int main()
15   f(1);