DR 1338
authorJason Merrill <jason@redhat.com>
Fri, 11 Apr 2014 18:24:57 +0000 (14:24 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 11 Apr 2014 18:24:57 +0000 (14:24 -0400)
DR 1338
* decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
built-in operator new.

From-SVN: r209313

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

index f722da3..04e4787 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-11  Jason Merrill  <jason@redhat.com>
+
+       DR 1338
+       * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
+       built-in operator new.
+
 2014-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/58600
index 3400594..069b374 100644 (file)
@@ -3847,8 +3847,12 @@ cxx_init_decl_processing (void)
     newtype = build_exception_variant (newtype, new_eh_spec);
     deltype = cp_build_type_attribute_variant (void_ftype_ptr, extvisattr);
     deltype = build_exception_variant (deltype, empty_except_spec);
-    DECL_IS_OPERATOR_NEW (push_cp_library_fn (NEW_EXPR, newtype, 0)) = 1;
-    DECL_IS_OPERATOR_NEW (push_cp_library_fn (VEC_NEW_EXPR, newtype, 0)) = 1;
+    tree opnew = push_cp_library_fn (NEW_EXPR, newtype, 0);
+    DECL_IS_MALLOC (opnew) = 1;
+    DECL_IS_OPERATOR_NEW (opnew) = 1;
+    opnew = push_cp_library_fn (VEC_NEW_EXPR, newtype, 0);
+    DECL_IS_MALLOC (opnew) = 1;
+    DECL_IS_OPERATOR_NEW (opnew) = 1;
     global_delete_fndecl = push_cp_library_fn (DELETE_EXPR, deltype, ECF_NOTHROW);
     push_cp_library_fn (VEC_DELETE_EXPR, deltype, ECF_NOTHROW);