+2004-11-15 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/18498
+ * c-decl.c (grokdeclarator): Call check_bitfield_type_and_width
+ after processing the declarator.
+
2004-11-15 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/altivec.md ("altivec_vsplth"): Rewrite with
&& TREE_CODE (type) == INTEGER_TYPE)
type = c_common_unsigned_type (type);
- /* Check the type and width of a bit-field. */
- if (bitfield)
- check_bitfield_type_and_width (&type, width, orig_name);
-
/* Figure out the type qualifiers for the declaration. There are
two ways a declaration can become qualified. One is something
like `const int i' where the `const' is explicit. Another is
/* Now TYPE has the actual type. */
+ /* Check the type and width of a bit-field. */
+ if (bitfield)
+ check_bitfield_type_and_width (&type, width, orig_name);
+
/* Did array size calculations overflow? */
if (TREE_CODE (type) == ARRAY_TYPE
+2004-11-15 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/18498
+ * gcc.dg/bitfld-13.c: New test.
+
2004-11-15 Janis Johnson <janis187@us.ibm.com>
* gcc.dg/vect/tree-vect.h: (check_vect): Test symbols defined for
--- /dev/null
+/* Test invalid bit-field types: bug 18498. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int
+main(void)
+{
+ struct X {
+ int s[20] : 1; /* { dg-error "error: bit-field 's' has invalid type" } */
+ int *p : 2; /* { dg-error "error: bit-field 'p' has invalid type" } */
+ int (*f)(float) : 3; /* { dg-error "error: bit-field 'f' has invalid type" } */
+ } x;
+ return 0;
+}