* c-decl.c (grokdeclarator): Handle incomplete type of unnamed
field.
testsuite:
* gcc.dg/noncompile/incomplete-5.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147174
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-05-06 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/40032
+ * c-decl.c (grokdeclarator): Handle incomplete type of unnamed
+ field.
+
2009-05-05 Jakub Jelinek <jakub@redhat.com>
* tree.h: Remove DECL_BY_REFERENCE from private_flag comment.
else if (TREE_CODE (type) != ERROR_MARK
&& !COMPLETE_OR_UNBOUND_ARRAY_TYPE_P (type))
{
- error ("field %qE has incomplete type", name);
+ if (name)
+ error ("field %qE has incomplete type", name);
+ else
+ error ("unnamed field has incomplete type");
type = error_mark_node;
}
type = c_build_qualified_type (type, type_quals);
+2009-05-06 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/40032
+ * gcc.dg/noncompile/incomplete-5.c: New test.
+
2009-05-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/39666
--- /dev/null
+/* ICE on unnamed field with incomplete enum type: PR 40032. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+struct A
+{
+ enum E : 8; /* { dg-warning "narrower than values of its type" } */
+ /* { dg-error "has incomplete type" "incomplete" { target *-*-* } 6 } */
+};