------- Comment #9 from fang at csl dot cornell dot edu 2007-03-11 03:47 ------- In fact, I'm having trouble reproducing the problem when operator delete [] returns anything BUT NULL. It's as if, the actual call to operator delete [] is guarded by a NULL check. Now, if I'm RTHS (reading the holy standard) correctly,
in [basic.stc.dynamic.deallocation] 3.7.4.2/3: "The value of the first argument supplied to a deallocation functions may be a null pointer value; if so, and if the deallocation function is one supplied in the standard library, the call has no effect." This seems to apply specifically to the standard library, but not necessarily non-standard implementations of the operator. Does that mean that the call to operator delete [] can be elided legally if the argument is NULL, or that the implementation of operator delete [] (NULL) is required to have no effect? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29164