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
/cp
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
vla4.C
blob
74bf66a07d9dcd1fc733859112f377b834d143ff
1
// Test for range-based for with VLAs.
2
// { dg-do run { target c++11 } }
3
// { dg-options "-Wno-vla" }
4
5
#include <new>
6
7
void f(int i)
8
{
9
int ar[i];
10
int j = 0;
11
for (int& x : ar)
12
x = ++j;
13
[&ar]{
14
int k = 0;
15
for (int x : ar)
16
if (x != ++k)
17
__builtin_abort();
18
}();
19
}
20
21
int main()
22
{
23
f(42); // OK
24
}