This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See for the official list.


353. Is deallocation routine called if destructor throws exception in delete?

Section:  [expr.delete]     Status: CD1     Submitter: Duane Smith     Date: 30 April 2002

[Voted into WP at April 2003 meeting.]

In a couple of comp.std.c++ threads, people have asked whether the Standard guarantees that the deallocation function will be called in a delete-expression if the destructor throws an exception. Most/all people have expressed the opinion that the deallocation function must be called in this case, although no one has been able to cite wording in the Standard supporting that view.

#include <new.h>
#include <stdio.h>
#include <stdlib.h>

static int flag = 0;

void operator delete(void* p) throw()
   if (flag)
        printf("in deallocation function\n");

struct S {
    ~S() { throw 0; }

void f() {
    try {
        delete new S;
    catch(...) { }

int main() {
       return 0;

Proposed resolution (October 2002):

Add to [expr.delete] paragraph 7 the highlighted text:

The delete-expression will call a deallocation function ( []) [Note: The deallocation function is called regardless of whether the destructor for the object or some element of the array throws an exception. ]