From: Jason Merrill Date: Fri, 11 Apr 2014 18:24:57 +0000 (-0400) Subject: DR 1338 X-Git-Tag: releases/gcc-5.1.0~8177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d0039a6fcd8fa25cf699c8a1ea30f8f8a92a8e7;p=thirdparty%2Fgcc.git DR 1338 DR 1338 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on built-in operator new. From-SVN: r209313 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f722da300e62..04e47878da29 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-04-11 Jason Merrill + + DR 1338 + * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on + built-in operator new. + 2014-04-11 Paolo Carlini PR c++/58600 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 34005944246f..069b37431987 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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);