]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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:50:12 +0000 (13:50 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 30 Apr 2002 17:50:12 +0000 (13:50 -0400)
        * decl.c (grokdeclarator): Don't override TYPE_NAME of an
        anonymous class with a typedef if there are attributes.

[[Split portion of a mixed commit.]]

From-SVN: r52955.1

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

index 97aad5a827811263bae5c2a33f6cb2389ec0f1bf..554e539957f1c968e7067927d997266f6ec24cd1 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 35a9315ad182731af42104c2fdefa087235f2d09..593963d7e8ea51a6c54f6440b1776717465a3f84 100644 (file)
@@ -11275,6 +11275,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);