From 8f2b097ed54816d28cd51254c8e4616404ae348e Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 13 Nov 2017 19:02:06 +0200 Subject: Remove the null check from placement new in all modes gcc/cp/ Remove the null check from placement new in all modes * init.c (build_new_1): Don't do a null check for a namespace-scope non-replaceable placement new in any mode unless -fcheck-new is provided. testsuite/ Remove the null check from placement new in all modes * g++.dg/init/pr35878_1.C: Adjust. * g++.dg/init/pr35878_4.C: New. * g++.dg/torture/pr48695.C: Adjust. * g++.dg/tree-ssa/pr31146-2.C: Likewise. * g++.dg/tree-ssa/pr41428.C: Adjust. From-SVN: r254694 --- gcc/cp/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/init.c') diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 9e6e3af..1fcd91d 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2758,7 +2758,7 @@ malloc_alignment () static bool std_placement_new_fn_p (tree alloc_fn) { - if ((cxx_dialect > cxx14) && DECL_NAMESPACE_SCOPE_P (alloc_fn)) + if (DECL_NAMESPACE_SCOPE_P (alloc_fn)) { tree first_arg = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (alloc_fn))); if ((TREE_VALUE (first_arg) == ptr_type_node) -- cgit v1.1