1 // PR c++/68613 - initializer-string for array of chars is too long error
2 // on flexible array member
4 // { dg-options "-Wpedantic -Wno-error=pedantic" }
8 char a[]; // { dg-warning "forbids flexible array member" }
12 { 4, { "abc" } }; // { dg-warning "initialization of a flexible array member" }
16 typedef __WCHAR_TYPE__ wchar_t;
21 wchar_t a[]; // { dg-warning "forbids flexible array member" }
24 struct FlexWchar awc =
25 { 3, { L"ab" } }; // { dg-warning "initialization of a flexible array member" }
30 int a[]; // { dg-warning "forbids flexible array member" }
33 // Verify that no warning is issued for the case when a flexible array
34 // member is not initialized (i.e., that a -Wmissing-field-initializer
35 // isn't issued) because such arrays need not have any elements.
40 { 0, { } }; // { dg-warning "initialization of a flexible array member" }
43 { 2, { 1, 2 } }; // { dg-warning "initialization of a flexible array member" }
51 T a[]; // { dg-warning "forbids flexible array member" }
54 struct FlexT<char> atc =
55 { 4, { "abc" } }; // { dg-warning "initialization of a flexible array member" }