diff options
author | Jason Merrill <jason@redhat.com> | 2004-04-30 18:26:48 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2004-04-30 18:26:48 -0400 |
commit | 672149847fcde1b055ddbcfff7849e3a6a4043aa (patch) | |
tree | f4d65d8bd351d2fdf24edc0ee51fdb6998ce6afc /gcc/attribs.c | |
parent | 269c559dab0e8ff21c33aae0186c8144d86f3bbe (diff) | |
download | gcc-672149847fcde1b055ddbcfff7849e3a6a4043aa.zip gcc-672149847fcde1b055ddbcfff7849e3a6a4043aa.tar.gz gcc-672149847fcde1b055ddbcfff7849e3a6a4043aa.tar.bz2 |
re PR c++/14587 (Multiple inheriance/DLL testcase (g++.dg/ext/dllexport-MI1.C) failures)
PR c++/14587
* config/i386/winnt.c (associated_type): Look for attributes on
the TYPE_MAIN_VARIANT of *this.
* attribs.c (decl_attributes): If ATTR_FLAG_TYPE_IN_PLACE, also
apply the attributes to the variants.
From-SVN: r81369
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c index 5d8450f..671528cca 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -294,7 +294,26 @@ decl_attributes (tree *node, tree attributes, int flags) if (DECL_P (*anode)) DECL_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs); else if (flags & (int) ATTR_FLAG_TYPE_IN_PLACE) - TYPE_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs); + { + TYPE_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs); + /* If this is the main variant, also push the attributes + out to the other variants. */ + if (*anode == TYPE_MAIN_VARIANT (*anode)) + { + tree variant; + for (variant = *anode; variant; + variant = TYPE_NEXT_VARIANT (variant)) + { + if (TYPE_ATTRIBUTES (variant) == old_attrs) + TYPE_ATTRIBUTES (variant) + = TYPE_ATTRIBUTES (*anode); + else if (!lookup_attribute + (spec->name, TYPE_ATTRIBUTES (variant))) + TYPE_ATTRIBUTES (variant) = tree_cons + (name, args, TYPE_ATTRIBUTES (variant)); + } + } + } else *anode = build_type_attribute_variant (*anode, tree_cons (name, args, |