annotate gcc/testsuite/g++.dg/ext/flexary6.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/68478 - flexible array members have complete type
kono
parents:
diff changeset
2 // { dg-do compile }
kono
parents:
diff changeset
3 // { dg-options "-Wno-error=pedantic" }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 // Test to verify that attempting to use a flexible array member where
kono
parents:
diff changeset
6 // a complete type is required is rejected.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 struct A {
kono
parents:
diff changeset
9 int n;
kono
parents:
diff changeset
10 int a[];
kono
parents:
diff changeset
11 enum {
kono
parents:
diff changeset
12 e = sizeof a // { dg-error "invalid application of .sizeof. to incomplete type" }
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14 };
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 struct B {
kono
parents:
diff changeset
17 int n;
kono
parents:
diff changeset
18 typedef int A[];
kono
parents:
diff changeset
19 A a;
kono
parents:
diff changeset
20 enum {
kono
parents:
diff changeset
21 e = sizeof a // { dg-error "invalid application of .sizeof. to incomplete type" }
kono
parents:
diff changeset
22 };
kono
parents:
diff changeset
23 };