* decl.c (grokdeclarator): Don't override TYPE_NAME of an
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Apr 2002 17:49:10 +0000 (17:49 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Apr 2002 17:49:10 +0000 (17:49 +0000)
        anonymous class with a typedef if there are attributes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52954 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c

index 3ef996b..d068caf 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-30  Jason Merrill  <jason@redhat.com>
+
+       * decl.c (grokdeclarator): Don't override TYPE_NAME of an
+       anonymous class with a typedef if there are attributes.
+
 2002-04-29  Paul Eggert  <eggert@twinsun.com>
 
        * parse.y (nomods_initdcl0): Replace $<ttype>3 with $<ttype>$.
index 9f03294..f354336 100644 (file)
@@ -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);