| 1 |
// N3639 allows initialization and capture of VLAs |
| 2 |
// { dg-do run { target c++11 } } |
| 3 |
// { dg-options "-Wno-vla" } |
| 4 |
|
| 5 |
void f(int n) |
| 6 |
{ |
| 7 |
int ar[n] = { 42 }; |
| 8 |
auto l = [&] { return ar[0]; }; |
| 9 |
if (l() != 42) __builtin_abort (); |
| 10 |
} |
| 11 |
|
| 12 |
int main() |
| 13 |
{ |
| 14 |
f(1); |
| 15 |
} |