decl.c (duplicate_decls): Use the new type when prototyping anticipated decls, even...
authorRoger Sayle <roger@eyesopen.com>
Tue, 18 Mar 2003 04:31:21 +0000 (04:31 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 18 Mar 2003 04:31:21 +0000 (04:31 +0000)
* decl.c (duplicate_decls): Use the new type when prototyping
anticipated decls, even when the types match.  This defines the
exception list for the built-in function.

From-SVN: r64522

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

index d6efa61c6e106717f02899540e38548594964e87..25cc235962ccf354cb3c219cbda6c82890bcbfaa 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-17  Roger Sayle  <roger@eyesopen.com>
+
+       * decl.c (duplicate_decls): Use the new type when prototyping
+       anticipated decls, even when the types match.  This defines the
+       exception list for the built-in function.
+
 2003-03-17  Jason Merrill  <jason@redhat.com>
 
        PR c++/10091
index e00a5f32e38b59e57629bfb78584053b814bc8a4..a0dba2fab1332f2fdb88eda4b64663e9ee363934 100644 (file)
@@ -3072,6 +3072,10 @@ duplicate_decls (tree newdecl, tree olddecl)
          /* Replace the old RTL to avoid problems with inlining.  */
          SET_DECL_RTL (olddecl, DECL_RTL (newdecl));
        }
+      /* 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);
 
       if (DECL_THIS_STATIC (newdecl) && !DECL_THIS_STATIC (olddecl))
        {