X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcp%2Fdecl2.c;h=a0ae6e4f7be2d4c91d441b5b5db447c4dde51095;hb=cb5526cd76771c78bf232a61fcf3472e0faaf5fc;hp=b326752746f1d41b05fd39267d6b59a29874c7f7;hpb=8e70fb09031df0afb5a38f40975bb174a8574ebd;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index b326752746f..a0ae6e4f7be 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -803,7 +803,17 @@ grokfield (const cp_declarator *declarator, 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; }