]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/13507 (spurious printf format warning)
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 1 Jan 2004 03:32:12 +0000 (03:32 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 1 Jan 2004 03:32:12 +0000 (19:32 -0800)
2003-12-20  Andrew Pinski  <pinskia@physics.uc.edu>

Backport from mainline:
2003-12-30  Nathan Sidwell  <nathan@codesourcery.com>

PR c++/13507
* decl.c (duplicate_decls): Use build_type_attribute_variant to
merge attributes.

From-SVN: r75293

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

index 8d99c75106ca5fcfbe40c47b3600f1f813b7156b..de88fec7d340e0619df5cc5303a9c6d1ff8537be 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-20  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       Backport from mainline:
+       2003-12-30  Nathan Sidwell  <nathan@codesourcery.com>
+
+               PR c++/13507
+               * decl.c (duplicate_decls): Use build_type_attribute_variant to
+               merge attributes.
+
 2003-12-30  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/13445
index f2572184396ae148a531e83797489955a8590c85..6f53cdde3bd7e02670d29bfc3a14f188c54c9792 100644 (file)
@@ -3416,10 +3416,12 @@ duplicate_decls (newdecl, olddecl)
         for anitipated built-ins, for exception lists, etc...  */
       else if (DECL_ANTICIPATED (olddecl))
        {
-         TYPE_ATTRIBUTES (TREE_TYPE (newdecl))
-           = (*targetm.merge_type_attributes) (TREE_TYPE (olddecl),
-                                               TREE_TYPE (newdecl));
-         TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
+         tree type = TREE_TYPE (newdecl);
+         tree attribs = (*targetm.merge_type_attributes)
+           (TREE_TYPE (olddecl), type);
+
+         type = build_type_attribute_variant (type, attribs);
+         TREE_TYPE (newdecl) = TREE_TYPE (olddecl) = type;
        }
 
       /* Whether or not the builtin can throw exceptions has no