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

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/46688 - [4.6 Regression] g++ requires a function declaration
kono
parents:
diff changeset
2 // when it should not
kono
parents:
diff changeset
3 // Note that although the definition of struct B in the test case for
kono
parents:
diff changeset
4 // c++/46688 was thought to be valid, it is, in fact, invalid, in C and
kono
parents:
diff changeset
5 // as noted in c++/42121, should be treated as invalid in C++ as well.
kono
parents:
diff changeset
6 // The test verifies that gcc detects and reports the right error.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 // { dg-options "" }
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 struct A {
kono
parents:
diff changeset
11 A(int);
kono
parents:
diff changeset
12 };
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 struct B {
kono
parents:
diff changeset
15 B() {}
kono
parents:
diff changeset
16 A a[]; // { dg-error "extension|flexible array .* in an otherwise empty" }
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 struct C {
kono
parents:
diff changeset
20 C() {}
kono
parents:
diff changeset
21 A a[0]; // -Wpedantic warning: ISO C++ forbids zero-size arrays
kono
parents:
diff changeset
22 };
kono
parents:
diff changeset
23