From aaceaa0f0578483b127c56992aa95d23561a078c Mon Sep 17 00:00:00 2001 From: jsm28 Date: Sun, 20 Mar 2005 01:52:35 +0000 Subject: * c-decl.c (check_bitfield_type_and_width): Require bit-field width to have integer type. (build_enumerator): Require enumerator value to have integer type. testsuite: * gcc.dg/bitfld-14.c, gcc.dg/enum3.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96755 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.dg/bitfld-14.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/bitfld-14.c (limited to 'gcc/testsuite/gcc.dg/bitfld-14.c') diff --git a/gcc/testsuite/gcc.dg/bitfld-14.c b/gcc/testsuite/gcc.dg/bitfld-14.c new file mode 100644 index 00000000000..eca0b03def0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/bitfld-14.c @@ -0,0 +1,11 @@ +/* Test for non-integer bit-field widths. */ +/* Origin: Joseph Myers */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +enum e { E, F }; +struct s { + int a : (void *)4; /* { dg-error "error: bit-field 'a' width not an integer constant" } */ + int b : (enum e)F; + int c : (_Bool)1; +}; -- cgit v1.2.1