summaryrefslogtreecommitdiff
path: root/gcc/attribs.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-02 19:28:05 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-02 19:28:05 +0000
commit9d63dbe6b454a33381a73e1ca93aff85b0594f05 (patch)
treef8a1cb507af3e7ceb424d8056fc0f50558e9cd28 /gcc/attribs.c
parentf98abc094eceacf320655d4f16c9f71243455544 (diff)
downloadgcc-9d63dbe6b454a33381a73e1ca93aff85b0594f05.tar.gz
2008-03-02 Basile Starynkevitch <basile@starynkevitch.net>
merged with trunk 132817 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@132818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r--gcc/attribs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 31b92cad508..767035b5dd1 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