-2009-11-09 Jason Merrill <jason@redhat.com>
+2009-11-10 Jason Merrill <jason@redhat.com>
+
+ * call.c (build_op_delete_call): Tweak error.
PR c++/34158
PR c++/36406
* pt.c (primary_template_instantiation_p): Non-static.
* cp-tree.h: Declare it.
+2009-11-09 Jason Merrill <jason@redhat.com>
+
PR c++/41972
* parser.c (cp_parser_template_argument): Accept SCOPE_REF around
VAR_DECL.
deallocation function, would have been selected as a match for the
allocation function, the program is ill-formed." */
if (non_placement_deallocation_fn_p (fn))
- error ("non-placement deallocation function %qD selected for "
- "placement delete", fn);
+ {
+ error ("non-placement deallocation function %q+D", fn);
+ error ("selected for placement delete");
+ }
}
else
/* "Any non-placement deallocation function matches a non-placement
-2009-11-09 Jason Merrill <jason@redhat.com>
+2009-11-10 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/init/placement5.C: New.
PR c++/34158
* g++.dg/init/placement4.C: New.
--- /dev/null
+// 5.3.4/19: 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.
+
+typedef __SIZE_TYPE__ size_t;
+
+struct A
+{
+ A();
+ static void* operator new (size_t, size_t);
+ static void operator delete (void *, size_t); // { dg-error "non-placement" }
+};
+
+int main()
+{
+ A* ap = new (24) A; // { dg-error "placement delete" }
+}