The code in the PR is correctly rejected now, this adds a test to
prevent regressions so the PR can be closed.

2011-06-04  Jonathan Wakely  <jwakely....@gmail.com>

        PR c++/33840
        * g++.dg/diagnostic/bitfld2.C: New.


Tested x86_64-linux, ok for trunk and 4.6?
Index: testsuite/g++.dg/diagnostic/bitfld2.C
===================================================================
--- testsuite/g++.dg/diagnostic/bitfld2.C       (revision 0)
+++ testsuite/g++.dg/diagnostic/bitfld2.C       (revision 0)
@@ -0,0 +1,9 @@
+// PR c++/33840
+// { dg-do compile }
+
+template<int> struct A
+{
+  struct {} : 2;   // { dg-error "expected ';' after struct" }
+};
+// { dg-error "ISO C.. forbids declaration" "" { target *-*-* } 6 }
+// { dg-error "ISO C.. prohibits anonymous" "" { target *-*-* } 6 }

Reply via email to