There is an issue with non-placement deallocation: In file included from ../../../../../../../src/ppl-0.10.2/src/Row.defs.hh:504:0, from ../../../../../../../src/ppl-0.10.2/src/Linear_Row.defs.hh:28, from ../../../../../../../src/ppl-0.10.2/src/Constraint.defs.hh:28, from ../../../../../../../src/ppl-0.10.2/src/Box.defs.hh:33, from ../../../../../../../src/ppl-0.10.2/src/Box.cc:24: ../../../../../../../src/ppl-0.10.2/src/Row.inlines.hh: In member function 'void Parma_Polyhedra_Library::Row::allocate(Parma_Polyhedra_Library::dimension_type, Parma_Polyhedra_Library::Row::Flags)': ../../../../../../../src/ppl-0.10.2/src/Row.inlines.hh:92:1: error: non-placement deallocation function 'static void Parma_Polyhedra_Library::Row_Impl_Handler::Impl::operator delete(void*, Parma_Polyhedra_Library::dimension_type)' ../../../../../../../src/ppl-0.10.2/src/Row.inlines.hh:224:31: error: selected for placement delete caused by: Author: jason Date: Tue Nov 10 18:18:51 2009 New Revision: 154072 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154072 Log: PR c++/34158 PR c++/36406 * call.c (non_placement_deallocation_fn_p): Split out... (build_op_delete_call): ...from here. Use instantiate_type for placement delete. Simplify logic. * pt.c (primary_template_instantiation_p): Non-static. * cp-tree.h: Declare it. Added: trunk/gcc/testsuite/g++.dg/init/placement4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/cp/cp-tree.h trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog and Author: jason Date: Tue Nov 10 18:31:22 2009 New Revision: 154073 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154073 Log: * call.c (build_op_delete_call): Tweak error. Added: trunk/gcc/testsuite/g++.dg/init/placement5.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/testsuite/ChangeLog
Created attachment 19063 [details] preprocessed source, still quite large
I just had another email exchange about this, but can't find it right now. Anyway, 5.3.4 [expr.new]: A declaration of a placement deallocation function matches the declaration of a placement allocation function if it has the same number of parameters and, after parameter transformations (8.3.5), all parameter types except the first are identical. Any non-placement deallocation function matches a non-placement allocation function. If the lookup finds a single matching deallocation function, that function will be called; otherwise, no deallocation function will be called. If the lookup finds the two-parameter form of a usual deallocation function (3.7.4.2) and that function, considered as a placement deallocation function, would have been selected as a match for the allocation function, the program is ill-formed. [ Example: struct S { // Placement allocation function: static void* operator new(std::size_t, std::size_t); // Usual (non-placement) deallocation function: static void operator delete(void*, std::size_t); }; // ill-formed: non-placement deallocation function matches // placement allocation function S* p = new (0) S; — end example ]
That said, I can see a reading whereby since PPL also defines operator delete (void *), the operator delete (void *, size_t) isn't the usual deallocation function, so we shouldn't give an error. I'll implement that.
Subject: Bug 42115 Author: jason Date: Fri Nov 20 05:03:21 2009 New Revision: 154357 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154357 Log: 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 *). Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/init/placement5.C
Fixed.