This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / testsuite / g++.dg / other / error8.C
blobd427e3c4c61623c3e70fbfad7064db52a073992a
1 // { dg-do compile }
2 // Contributed by: Michael Elizabeth Chastain 
3 //   <mec dot gnu at mindspring dot com>
4 // PR c++/13927: Wrong error message for redeclartion of type from union
6 void foo(void)
8   union { int alpha; int beta; }; // { dg-error "previous declaration `int alpha'" }
9   double alpha;  // { dg-error "declaration of" }
12 // This checks both the templated version, and the position of the diagnostic
13 //  (which is currently wrong).
14 template <int>
15 void tfoo(void)
17   union { 
18     int alpha;  // { dg-error "" "" { xfail *-*-* } }
19     int beta; 
20   }; // { dg-bogus "" "misplaced position of the declaration" { xfail *-*-* } }
21   double alpha; // { dg-error "" "" }
24 // The duplicated error messages are xfailed for now (tracked in the PR)
25 // { dg-bogus "" "duplicate error messages" { xfail *-*-* } 8 }
26 // { dg-bogus "" "duplicate error messages" { xfail *-*-* } 9 }