From ac905924b6341421aa03e3895d906a266c391330 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 30 Apr 2002 13:49:10 -0400 Subject: [PATCH] decl.c (grokdeclarator): Don't override TYPE_NAME of an anonymous class with a typedef if... * decl.c (grokdeclarator): Don't override TYPE_NAME of an anonymous class with a typedef if there are attributes. From-SVN: r52954 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3ef996bffd8..d068caf8786 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2002-04-30 Jason Merrill + + * decl.c (grokdeclarator): Don't override TYPE_NAME of an + anonymous class with a typedef if there are attributes. + 2002-04-29 Paul Eggert * parse.y (nomods_initdcl0): Replace $3 with $$. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9f03294c94a..f354336d3c3 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11262,6 +11262,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) && TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && TYPE_ANONYMOUS_P (type) + /* Don't do this if there are attributes. */ + && (!attrlist || !*attrlist) && cp_type_quals (type) == TYPE_UNQUALIFIED) { tree oldname = TYPE_NAME (type); -- 2.30.2