decl.c (grokdeclarator): Don't override TYPE_NAME of an anonymous class with a typede...
authorJason Merrill <jason@redhat.com>
Tue, 30 Apr 2002 17:49:10 +0000 (13:49 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 30 Apr 2002 17:49:10 +0000 (13:49 -0400)
        * 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
gcc/cp/decl.c

index 3ef996bffd8c23544f8bf62cf68cb3ff3893a289..d068caf87867e077b0d142511cc4673c1fe1e9b9 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 9f03294c94a870a50d26c1843c419729c1a85928..f354336d3c3bdf7be9bd53885b64c4e2910cf1d4 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);