2008-11-19 Jason Merrill <jason@redhat.com>
+ PR c++/36410
+ * decl2.c (grokfield): Pass ATTR_FLAG_TYPE_IN_PLACE for a typedef
+ that names a class for linkage purposes.
+
PR c++/37563
* parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor
name is not a declaration.
value = push_template_decl (value);
if (attrlist)
- cplus_decl_attributes (&value, attrlist, 0);
+ {
+ int attrflags = 0;
+
+ /* If this is a typedef that names the class for linkage purposes
+ (7.1.3p8), apply any attributes directly to the type. */
+ if (TAGGED_TYPE_P (TREE_TYPE (value))
+ && value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))))
+ attrflags = ATTR_FLAG_TYPE_IN_PLACE;
+
+ cplus_decl_attributes (&value, attrlist, attrflags);
+ }
return value;
}