1 // PR c++/69290 - [6 Regression] g++ ICE on invalid initialization
2 // of a flexible array member
5 // Suppress pedantic errors about initialization of a flexible array member.
6 // { dg-options "-Wno-pedantic" }
9 int a []; // { dg-error "flexible array member .A::a. in an otherwise empty .struct A." }
14 // This is the meat of the test from c++/69290:
16 = { "c" }; // { dg-error "invalid conversion from .const char\\*. to .int." }
22 // Exercise other forms of invalid initialization besides the one in the bug.
31 = { 0, "c" }; // { dg-error "invalid conversion from .const char\\*. to .int." }
37 = { 0, s }; // { dg-error "invalid conversion from .const char\\*. to .int." }
43 int a []; // { dg-error "flexible array member .D::a. in an otherwise empty .struct D." }
47 D::D (): // { dg-error "initializer for flexible array member" }
48 a ("c") // the initializer also has an invalid type but emitting
49 // just the error above is sufficient
55 T a []; // { dg-error "flexible array member" }
61 = { "c" }; // { dg-error "cannot convert .const char\\*. to .double." }