From c57e4b48f52e06a158979a358509b6673f913237 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Thu, 1 Jan 2004 03:32:12 +0000 Subject: [PATCH] backport: re PR c++/13507 (spurious printf format warning) 2003-12-20 Andrew Pinski Backport from mainline: 2003-12-30 Nathan Sidwell PR c++/13507 * decl.c (duplicate_decls): Use build_type_attribute_variant to merge attributes. From-SVN: r75293 --- gcc/cp/ChangeLog | 9 +++++++++ gcc/cp/decl.c | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8d99c75106ca..de88fec7d340 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2003-12-20 Andrew Pinski + + Backport from mainline: + 2003-12-30 Nathan Sidwell + + PR c++/13507 + * decl.c (duplicate_decls): Use build_type_attribute_variant to + merge attributes. + 2003-12-30 Nathan Sidwell PR c++/13445 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f2572184396a..6f53cdde3bd7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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 -- 2.47.2