Patchwork add test for PR c++/33840

login
register
mail settings
Submitter Jonathan Wakely
Date June 4, 2011, 12:59 p.m.
Message ID <BANLkTi=NirP0XYgu_-k1WjKJ-DWu2p2NYQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/98726/
State New
Headers show

Comments

Jonathan Wakely - June 4, 2011, 12:59 p.m.
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.gcc@gmail.com>

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


Tested x86_64-linux, ok for trunk and 4.6?
Jason Merrill - June 4, 2011, 3:49 p.m.
OK.

Jason

Patch

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 }