Note that this optimization is only permitted when new-expressions are used, not any other methods to call a replaceable allocation function: delete new int[10]; can be optimized out, but operator delete(operator new(10)); cannot.