diff options
author | Jason Merrill <jason@redhat.com> | 2008-02-26 13:09:02 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2008-02-26 13:09:02 -0500 |
commit | 317c435f413d27d35d8abcfb7ee40dc4f3167f53 (patch) | |
tree | 0a295d469e667b407d72e2be5dc3b6409999416f /gcc/attribs.c | |
parent | f82c41ea91a0cf691c9a59ca9219e63933c0d9fb (diff) | |
download | gcc-317c435f413d27d35d8abcfb7ee40dc4f3167f53.zip gcc-317c435f413d27d35d8abcfb7ee40dc4f3167f53.tar.gz gcc-317c435f413d27d35d8abcfb7ee40dc4f3167f53.tar.bz2 |
re PR c++/35315 (ICE with attribute transparent_union)
PR c++/35315
* attribs.c (decl_attributes): Leave ATTR_FLAG_TYPE_IN_PLACE
alone if it's the naming decl for the type's main variant.
* cp/decl.c (grokdeclarator): Allow a typedef of an unnamed struct
to name the struct for linkage purposes even if it has attributes.
(start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
From-SVN: r132681
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c index 31b92ca..767035b 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -280,7 +280,11 @@ decl_attributes (tree *node, tree attributes, int flags) if (spec->type_required && DECL_P (*anode)) { anode = &TREE_TYPE (*anode); - flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE; + /* Allow ATTR_FLAG_TYPE_IN_PLACE for the type's naming decl. */ + if (!(TREE_CODE (*anode) == TYPE_DECL + && *anode == TYPE_NAME (TYPE_MAIN_VARIANT + (TREE_TYPE (*anode))))) + flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE; } if (spec->function_type_required && TREE_CODE (*anode) != FUNCTION_TYPE |