diff options
author | Jakub Jelinek <jakub@redhat.com> | 2003-08-24 00:18:54 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2003-08-24 00:18:54 +0200 |
commit | 61c234ce879e13e580cdfa383a59881753add6a8 (patch) | |
tree | 78a76c5ec38f223d94c70b1761e375c81455986b /gcc/c-decl.c | |
parent | ebe75517d4ffdb7045a607c6c5426306dbf662ee (diff) | |
download | gcc-61c234ce879e13e580cdfa383a59881753add6a8.zip gcc-61c234ce879e13e580cdfa383a59881753add6a8.tar.gz gcc-61c234ce879e13e580cdfa383a59881753add6a8.tar.bz2 |
c-decl.c (pushdecl): Only put decls which finish_struct will do something about onto incomplete chain.
* c-decl.c (pushdecl): Only put decls which finish_struct will do
something about onto incomplete chain.
(finish_struct): If not removing type from incomplete
list, update prev.
* gcc.dg/20030815-1.c: New test.
From-SVN: r70752
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index de4b443..721946e 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1760,8 +1760,10 @@ pushdecl (tree x) while (TREE_CODE (element) == ARRAY_TYPE) element = TREE_TYPE (element); - if (TREE_CODE (element) == RECORD_TYPE - || TREE_CODE (element) == UNION_TYPE) + if ((TREE_CODE (element) == RECORD_TYPE + || TREE_CODE (element) == UNION_TYPE) + && (TREE_CODE (x) != TYPE_DECL + || TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE)) scope->incomplete = tree_cons (NULL_TREE, x, scope->incomplete); } } @@ -5154,7 +5156,8 @@ finish_struct (tree t, tree fieldlist, tree attributes) && TREE_CODE (decl) != TYPE_DECL) { layout_decl (decl, 0); - /* This is a no-op in c-lang.c or something real in objc-act.c. */ + /* This is a no-op in c-lang.c or something real in + objc-act.c. */ if (c_dialect_objc ()) objc_check_decl (decl); rest_of_decl_compilation (decl, NULL, toplevel, 0); @@ -5190,7 +5193,11 @@ finish_struct (tree t, tree fieldlist, tree attributes) else current_scope->incomplete = TREE_CHAIN (x); } + else + prev = x; } + else + prev = x; } } |