annotate gcc/testsuite/g++.dg/ext/flexary11.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/69253 - [6 Regression] g++ ICE at -O0 on x86_64-linux-gnu
kono
parents:
diff changeset
2 // in "cxx_incomplete_type_diagnostic"
kono
parents:
diff changeset
3 // { dg-do compile }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 struct A {
kono
parents:
diff changeset
6 int n;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
7 char a[]; // { dg-error "8:ISO C\\+\\+ forbids flexible array member" }
111
kono
parents:
diff changeset
8 };
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 void f ()
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 // Compound literals and flexible array members are G++ extensions
kono
parents:
diff changeset
13 // accepted for compatibility with C and GCC.
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 // The following use of a flexible array member in a compound literal
kono
parents:
diff changeset
16 // is invalid in C and rejected by GCC in C mode and so it's also
kono
parents:
diff changeset
17 // rejected in C++ mode.
kono
parents:
diff changeset
18 (struct A){ 1, "" }; // { dg-error "forbids compound-literals|initialization of a flexible array member|invalid use of a flexible array member" }
kono
parents:
diff changeset
19 }