]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/30225 (builtins's decl is copied in some cases where it is not needed to...
authorAndrew Pinski <pinskia@gmail.com>
Fri, 22 Dec 2006 08:31:03 +0000 (00:31 -0800)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 22 Dec 2006 08:31:03 +0000 (00:31 -0800)
2006-12-21  Andrew Pinski  <pinskia@gmail.com>

        PR C++/30225
        * decl.c (cxx_builtin_function): Only copy the decl if adding
        it to the std namespace

From-SVN: r120145

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

index caad0ec0fd52776cf7555d2d668d2a4475b165b1..5009ebaa25189473ab115b70acd8cc4ae88365aa 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-21  Andrew Pinski  <pinskia@gmail.com>
+
+       PR C++/30225
+       * decl.c (cxx_builtin_function): Only copy the decl if adding
+       it to the std namespace.
+
 2006-12-21  Andrew Pinski  <pinskia@gmail.com>
 
        PR C++/30168
index 5c7d508fc3e19b8cefb5f96f8a95b172923c274b..6a46636ea10fb8debaaaeed039686c3ae6da30e1 100644 (file)
@@ -3402,17 +3402,17 @@ cxx_builtin_function (tree decl)
 {
   tree          id = DECL_NAME (decl);
   const char *name = IDENTIFIER_POINTER (id);
-  tree       decl2 = copy_node(decl);
   /* All builtins that don't begin with an '_' should additionally
      go in the 'std' namespace.  */
   if (name[0] != '_')
     {
+      tree decl2 = copy_node(decl);
       push_namespace (std_identifier);
-      builtin_function_1 (decl, std_node);
+      builtin_function_1 (decl2, std_node);
       pop_namespace ();
     }
 
-  return builtin_function_1 (decl2, NULL_TREE);
+  return builtin_function_1 (decl, NULL_TREE);
 }
 
 /* Generate a FUNCTION_DECL with the typical flags for a runtime library