diff options
author | Joseph Myers <joseph@codesourcery.com> | 2009-05-06 14:02:48 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2009-05-06 14:02:48 +0100 |
commit | 1202aec13afaad0122c00e8013aa22cf96057c59 (patch) | |
tree | 3ef6e479f502d90859c2fba68e8d1acf0815d045 /gcc/c-decl.c | |
parent | 483c78cb8e390ab868a6e489d932460942d8c4d9 (diff) | |
download | gcc-1202aec13afaad0122c00e8013aa22cf96057c59.zip gcc-1202aec13afaad0122c00e8013aa22cf96057c59.tar.gz gcc-1202aec13afaad0122c00e8013aa22cf96057c59.tar.bz2 |
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
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index a851c6d..85c4d6b 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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); |