[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / ext / flexary11.C
blobf958cc5555a4fdbc0866fec6bd9af990339e0aed
1 // PR c++/69253 - [6 Regression] g++ ICE at -O0 on x86_64-linux-gnu
2 //                in "cxx_incomplete_type_diagnostic"
3 // { dg-do compile }
5 struct A {
6   int n;
7   char a[];   // { dg-error "forbids flexible array member" }
8 };
10 void f ()
12   // Compound literals and flexible array members are G++ extensions
13   // accepted for compatibility with C and GCC.
15   // The following use of a flexible array member in a compound literal
16   // is invalid in C and rejected by GCC in C mode and so it's also
17   // rejected in C++ mode.
18   (struct A){ 1, "" };   // { dg-error "forbids compound-literals|initialization of a flexible array member|invalid use of a flexible array member" }