aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@gmail.com>2017-11-13 19:02:06 +0200
committerVille Voutilainen <ville@gcc.gnu.org>2017-11-13 19:02:06 +0200
commit8f2b097ed54816d28cd51254c8e4616404ae348e (patch)
treeda7596f768a618dc8ddfbf2e19b6126dcb440a16 /gcc/cp
parent81766d13a8e51e7432e2c1ff3fd1ef4735e3b820 (diff)
downloadgcc-8f2b097ed54816d28cd51254c8e4616404ae348e.zip
gcc-8f2b097ed54816d28cd51254c8e4616404ae348e.tar.gz
gcc-8f2b097ed54816d28cd51254c8e4616404ae348e.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/init.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index df912013..73fa999 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ 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.
+
2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
* Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
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)