]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/13070 (-Wformat option ignored in g++)
authorRoger Sayle <sayle@gcc.gnu.org>
Mon, 29 Dec 2003 05:32:32 +0000 (05:32 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 29 Dec 2003 05:32:32 +0000 (05:32 +0000)
PR c++/13070
* decl.c (duplicate_decls): When setting the type of an anticipated
declaration, merge the existing type attributes.

* g++.dg/warn/format3.C: New test case.

From-SVN: r75194

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

index 6949ed133dab431c80b9cf9bbd79c3470e54c420..9de401759067d9db5f36041796b7a77081721dca 100644 (file)
@@ -1,11 +1,17 @@
-2003-12-27  Giovanni Bajo  <giovannibajo@gcc.gnu.org>\r
-\r
-       Backport from mainline:\r
-       2003-12-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>\r
-\r
-       PR c++/2294\r
-       * decl.c (push_overloaded_decl): always construct an OVERLOAD\r
-       if the declaration comes from an using declaration.\r
+2003-12-28  Roger Sayle  <roger@eyesopen.com>
+
+       PR c++/13070
+       * decl.c (duplicate_decls): When setting the type of an anticipated
+       declaration, merge the existing type attributes.
+
+2003-12-27  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       Backport from mainline:
+       2003-12-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/2294
+       * decl.c (push_overloaded_decl): always construct an OVERLOAD
+       if the declaration comes from an using declaration.
 
 2003-12-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
index 504101da3736ec5ed393bd9ab28c926e7d2ed25f..f2572184396ae148a531e83797489955a8590c85 100644 (file)
@@ -3415,7 +3415,12 @@ duplicate_decls (newdecl, olddecl)
       /* Even if the types match, prefer the new declarations type
         for anitipated built-ins, for exception lists, etc...  */
       else if (DECL_ANTICIPATED (olddecl))
-       TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
+       {
+         TYPE_ATTRIBUTES (TREE_TYPE (newdecl))
+           = (*targetm.merge_type_attributes) (TREE_TYPE (olddecl),
+                                               TREE_TYPE (newdecl));
+         TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
+       }
 
       /* Whether or not the builtin can throw exceptions has no
         bearing on this declarator.  */
index a2199afe44098df60b52c551a63bd099584bf562..dbb8fef876e78a29e989e066a77b04d4175891cd 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-28  Roger Sayle  <roger@eyesopen.com>
+
+       PR c++/13070
+       * g++.dg/warn/format3.C: New test case.
+
 2003-12-27  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        Backport from mainline: