annotate gcc/testsuite/g++.dg/other/error8.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile }
kono
parents:
diff changeset
2 // Contributed by: Michael Elizabeth Chastain
kono
parents:
diff changeset
3 // <mec dot gnu at mindspring dot com>
kono
parents:
diff changeset
4 // PR c++/13927: Wrong error message for redeclartion of type from union
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 void foo(void)
kono
parents:
diff changeset
7 {
kono
parents:
diff changeset
8 union { int alpha; int beta; }; // { dg-message "previous declaration" }
kono
parents:
diff changeset
9 double alpha; // { dg-error "conflicting declaration" }
kono
parents:
diff changeset
10 }
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 // This checks both the templated version, and the position of the diagnostic
kono
parents:
diff changeset
13 // (which is currently wrong).
kono
parents:
diff changeset
14 template <int>
kono
parents:
diff changeset
15 void tfoo(void)
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 union {
kono
parents:
diff changeset
18 int alpha; // { dg-error "" "" { xfail *-*-* } }
kono
parents:
diff changeset
19 int beta;
kono
parents:
diff changeset
20 }; // { dg-bogus "" "misplaced position of the declaration" { xfail *-*-* } }
kono
parents:
diff changeset
21 double alpha; // { dg-error "" }
kono
parents:
diff changeset
22 }