Commit 1202aec1 by Joseph Myers Committed by Joseph Myers

re PR c/40032 (ICE with incomplete type in struct)

	PR c/40032
	* c-decl.c (grokdeclarator): Handle incomplete type of unnamed
	field.

testsuite:
	* gcc.dg/noncompile/incomplete-5.c: New test.

From-SVN: r147174
parent 483c78cb
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.
......
......@@ -5021,7 +5021,10 @@ grokdeclarator (const struct c_declarator *declarator,
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
......
/* 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 } */
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment