Debian Codegraph @

gcc/testsuite/g++.dg/ext/flexary22.C

raw
1 // PR c++/79363 - ICE with NSDMI and array
2 // { dg-do compile { target c++11 } }
3 // { dg-options -Wno-pedantic }
4
5 struct A
6 {
7 int i;
8 int a[] = { }; // { dg-error "initializer for flexible array member" }
9 } a;
10
11 struct B
12 {
13 int i;
14 char a[] { "abc" }; // { dg-error "initializer for flexible array member" }
15 } b;
16
17 struct C
18 {
19 int i;
20 char a[];
21 C (): a ("def") { } // { dg-error "initializer for flexible array member" }
22 } c;
23
24 struct D
25 {
26 struct X { };
27 int i;
28 X x[] = { }; // { dg-error "initializer for flexible array member" }
29 } d;