Commit 67a6e816 by Jason Merrill Committed by Jason Merrill

Core issue 901

	Core issue 901
	* libsupc++/vec.cc (__cxa_vec_new2, __cxa_vec_new3): Handle NULL
	dealloc.
	* call.c (build_op_delete_call): If this is for a new-expression
	and the op delete is deleted, do nothing.

From-SVN: r150073
parent 05b5c4e8
2009-07-24 Jason Merrill <jason@redhat.com> 2009-07-24 Jason Merrill <jason@redhat.com>
Core issue 901
* call.c (build_op_delete_call): If this is for a new-expression
and the op delete is deleted, do nothing.
Core issue 702 Core issue 702
* call.c (compare_ics): Give list-initialization of std::init_list * call.c (compare_ics): Give list-initialization of std::init_list
priority over conversion to scalar, too. priority over conversion to scalar, too.
......
...@@ -4595,6 +4595,10 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, ...@@ -4595,6 +4595,10 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
if (DECL_CLASS_SCOPE_P (fn)) if (DECL_CLASS_SCOPE_P (fn))
perform_or_defer_access_check (TYPE_BINFO (type), fn, fn); perform_or_defer_access_check (TYPE_BINFO (type), fn, fn);
/* Core issue 901: It's ok to new a type with deleted delete. */
if (DECL_DELETED_FN (fn) && alloc_fn)
return NULL_TREE;
if (placement) if (placement)
{ {
/* The placement args might not be suitable for overload /* The placement args might not be suitable for overload
......
2009-07-24 Jason Merrill <jason@redhat.com> 2009-07-24 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/defaulted11.C: New.
* g++.dg/cpp0x/initlist23.C: New. * g++.dg/cpp0x/initlist23.C: New.
2009-07-24 Janus Weil <janus@gcc.gnu.org> 2009-07-24 Janus Weil <janus@gcc.gnu.org>
......
// Core issue 901
// { dg-options "-std=c++0x" }
struct A
{
A(); ~A();
void operator delete (void *) = delete;
void operator delete[] (void *) = delete;
};
int main()
{
A* ap = new A;
ap = new A[2];
}
2009-07-24 Jason Merrill <jason@redhat.com>
Core issue 901
* libsupc++/vec.cc (__cxa_vec_new2, __cxa_vec_new3): Handle NULL
dealloc.
2009-07-24 Joseph Myers <joseph@codesourcery.com> 2009-07-24 Joseph Myers <joseph@codesourcery.com>
* include/c_global/cwchar (swprintf, vswprintf): Do not use if * include/c_global/cwchar (swprintf, vswprintf): Do not use if
......
...@@ -104,7 +104,10 @@ namespace __cxxabiv1 ...@@ -104,7 +104,10 @@ namespace __cxxabiv1
{ {
{ {
uncatch_exception ue; uncatch_exception ue;
dealloc(base - padding_size); // Core issue 901 will probably be resolved such that a
// deleted operator delete means not freeing memory here.
if (dealloc)
dealloc(base - padding_size);
} }
__throw_exception_again; __throw_exception_again;
} }
...@@ -142,7 +145,8 @@ namespace __cxxabiv1 ...@@ -142,7 +145,8 @@ namespace __cxxabiv1
{ {
{ {
uncatch_exception ue; uncatch_exception ue;
dealloc(base - padding_size, size); if (dealloc)
dealloc(base - padding_size, size);
} }
__throw_exception_again; __throw_exception_again;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment