re PR c++/33840 (bit-field size accepted for struct)
authorJonathan Wakely <jwakely.gcc@gmail.com>
Sat, 4 Jun 2011 16:11:41 +0000 (16:11 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 4 Jun 2011 16:11:41 +0000 (17:11 +0100)
2011-06-04  Jonathan Wakely  <jwakely.gcc@gmail.com>

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

From-SVN: r174642

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/bitfld2.C [new file with mode: 0644]

index 483bffc6dd219e7b7a6e84ff1b0c38dbafeb9573..fb95911a9323e73d3493516de4408c17b4c0e3a3 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-04  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       PR c++/33840
+       * g++.dg/diagnostic/bitfld2.C: New.
+
 2011-06-04  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/49281
diff --git a/gcc/testsuite/g++.dg/diagnostic/bitfld2.C b/gcc/testsuite/g++.dg/diagnostic/bitfld2.C
new file mode 100644 (file)
index 0000000..10b7d9c
--- /dev/null
@@ -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 }