aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-11-20 00:03:21 -0500
committerJason Merrill <jason@gcc.gnu.org>2009-11-20 00:03:21 -0500
commit5cd25f0725e01635bd3f8da6ae91d41670e18a1f (patch)
treee9a6a73054ca153a6753e107531289d9d19e7624 /gcc/cp
parent98fba7f7af1ee1286264f56447be91a4a8e67d49 (diff)
downloadgcc-5cd25f0725e01635bd3f8da6ae91d41670e18a1f.zip
gcc-5cd25f0725e01635bd3f8da6ae91d41670e18a1f.tar.gz
gcc-5cd25f0725e01635bd3f8da6ae91d41670e18a1f.tar.bz2
re PR c++/42115 (r154072 & r154073 break build of ppl, non-placement deallocation issue)
PR c++/42115 * call.c (build_op_delete_call): Don't complain about using op delete (void *, size_t) for placement delete if there's an op delete (void *). From-SVN: r154357
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c25d360..042e637 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2009-11-19 Jason Merrill <jason@redhat.com>
+ PR c++/42115
+ * call.c (build_op_delete_call): Don't complain about using
+ op delete (void *, size_t) for placement delete if there's an
+ op delete (void *).
+
DR 176 permissiveness
* class.c (build_self_reference): Call set_underlying_type.
* decl.c (check_elaborated_type_specifier): Don't complain about
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ca6bd0b..3b3ccb6 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4622,8 +4622,20 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
allocation function, the program is ill-formed." */
if (non_placement_deallocation_fn_p (fn))
{
+ /* But if the class has an operator delete (void *), then that is
+ the usual deallocation function, so we shouldn't complain
+ about using the operator delete (void *, size_t). */
+ for (t = BASELINK_P (fns) ? BASELINK_FUNCTIONS (fns) : fns;
+ t; t = OVL_NEXT (t))
+ {
+ tree elt = OVL_CURRENT (t);
+ if (non_placement_deallocation_fn_p (elt)
+ && FUNCTION_ARG_CHAIN (elt) == void_list_node)
+ goto ok;
+ }
permerror (0, "non-placement deallocation function %q+D", fn);
permerror (input_location, "selected for placement delete");
+ ok:;
}
}
else