From f90d37ec0c1fbac6a987b546167ba9a26d399c5f Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 4 Jun 2011 16:11:41 +0000 Subject: [PATCH] re PR c++/33840 (bit-field size accepted for struct) 2011-06-04 Jonathan Wakely PR c++/33840 * g++.dg/diagnostic/bitfld2.C: New. From-SVN: r174642 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/diagnostic/bitfld2.C | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 gcc/testsuite/g++.dg/diagnostic/bitfld2.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 483bffc6dd2..fb95911a932 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-04 Jonathan Wakely + + PR c++/33840 + * g++.dg/diagnostic/bitfld2.C: New. + 2011-06-04 Jakub Jelinek 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 index 00000000000..10b7d9cea50 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/bitfld2.C @@ -0,0 +1,9 @@ +// PR c++/33840 +// { dg-do compile } + +template 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 } -- 2.30.2