/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / vla-initlist1.C
blobba485df65fe9f8295e8a3bad3678810dbf735451
1 // { dg-do run { target c++11 } }
2 // { dg-skip-if "power overwrites two slots of array i" { "power*-*-*" } }
3 // { dg-options "-Wno-vla" }
5 #include <initializer_list>
7 struct A
9   int i;
10   A(std::initializer_list<int>) { }
11   A(int i): i{i} { }
12   ~A() {}
15 int x = 4;
16 int main(int argc, char **argv)
18   { int i[x] = { 42, 42, 42, 42 }; }
19   {
20     A a[x] = { argc };
21     if (a[1].i != 42)
22       __builtin_abort ();
23   }