fortran/openmp.cc: Fix var init and locus use to avoid uninit values [PR fortran...
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / lambda-generic-vla1.C
blob94d18605057bd760845a6bafef19f64f6c4bf942
1 // PR c++/59271
2 // { dg-do compile { target c++14 } }
3 // { dg-options "-Wno-vla" }
4 // { dg-require-effective-target alloca }
6 extern "C" int printf (const char *, ...);
8 void f(int n)
10   int  a[n];
12   for (auto& i : a)
13     {
14       i = &i - a;
15     }
17   [&a] (auto m)
18     {
19       for (auto i : a)
20         {
21           printf ("%d", i);
22         }
24       return m;
25     };