[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / ext / flexary6.C
blob92677cd2aab4afb6ca06b563c789a3065731cdf0
1 // PR c++/68478 - flexible array members have complete type
2 // { dg-do compile }
3 // { dg-options "-Wno-error=pedantic" }
5 // Test to verify that attempting to use a flexible array member where
6 // a complete type is required is rejected.
8 struct A {
9   int n;
10   int a[];
11   enum {
12     e = sizeof a   // { dg-error "invalid application of .sizeof. to incomplete type" }
13   };
16 struct B {
17   int n;
18   typedef int A[];
19   A a;
20   enum {
21     e = sizeof a   // { dg-error "invalid application of .sizeof. to incomplete type" }
22   };