From d51ca159d6978fd57fd4fed8a682a3524ae1fd0a Mon Sep 17 00:00:00 2001 From: jsm28 Date: Sat, 29 Nov 2003 20:09:48 +0000 Subject: PR c/10333 * c-parse.in (typespec_reserved_nonattr): Reject typeof on bit-fields. testsuite: * gcc.dg/bitfld-7.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74036 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.dg/bitfld-7.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/bitfld-7.c (limited to 'gcc/testsuite/gcc.dg/bitfld-7.c') diff --git a/gcc/testsuite/gcc.dg/bitfld-7.c b/gcc/testsuite/gcc.dg/bitfld-7.c new file mode 100644 index 00000000000..70004ffd8cb --- /dev/null +++ b/gcc/testsuite/gcc.dg/bitfld-7.c @@ -0,0 +1,8 @@ +/* Test for rejection of typeof on bit-fields. PR c/10333. */ +/* Origin: Joseph Myers */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct { int a:1; } x; + +typeof (x.a) z; /* { dg-error "applied to a bit-field" "typeof" } */ -- cgit v1.2.1