Full name of submitter (unless configured in github; will be published with the issue): Jim X
[expr.new] p27 says:
If any part of the object initialization described above61 terminates by throwing an exception and a suitable deallocation function can be found, the deallocation function is called to free the memory in which the object was being constructed, after which the exception continues to propagate in the context of the new-expression.
The major implementations do not invoke the deallocation, instead, the program is directly terminated. However, the wording says that the exception continues to propagate after the deallocation is called, that is, [except.handle] p9 should apply later.
If no matching handler is found, the function std::terminate is invoked; whether or not the stack is unwound before this invocation of std::terminate is implementation-defined ([except.terminate]).
If wrapping new A(); by a try-catch statement, then delete will be printed.
Full name of submitter (unless configured in github; will be published with the issue): Jim X
[expr.new] p27 says:
Consider this example:
The major implementations do not invoke the deallocation, instead, the program is directly terminated. However, the wording says that the exception continues to propagate after the deallocation is called, that is, [except.handle] p9 should apply later.
If wrapping
new A();
by a try-catch statement, thendelete
will be printed.