repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
vla2.C
blob
07c300884a37ef43ab248dbed22a3a4d1b0c813e
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
}