This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-12-19
[Voted into WP at March, 2010 meeting.]
14.2 [except.throw] paragraph 4 says,
When the last remaining active handler for the exception exits by any means other than throw; the temporary object is destroyed and the implementation may deallocate the memory for the temporary object...
With std::current_exception() (17.9.7 [propagation] paragraph 7) , it might be possible to refer to the exception object after its last handler exits (if the exception object is not copied). The text needs to be updated to allow for that possibility.
Proposed resolution (September, 2009):
Change 14.2 [except.throw] paragraph 4 as follows:
The memory for thetemporary copy of the exception being thrownexception object is allocated in an unspecified way, except as noted in 6.7.6.5.2 [basic.stc.dynamic.allocation].The temporary persists as long as there is a handler being executed for that exception. In particular, ifIf a handler exits byexecuting a throw; statement, that passes controlrethrowing, control is passed to another handler for the same exception, so the temporary remains. The exception object is destroyed after eitherWhenthe last remaining active handler for the exception exits by any means other thanthrow;rethrowing, or the last object of type std::exception_ptr (17.9.7 [propagation]) that refers to the exception object is destroyed, whichever is later. In the former case, the destruction occurs when the handler exits, immediately after the destruction of the object declared in the exception-declaration in the handler, if any. In the latter case, the destruction occurs before the destructor of std::exception_ptr returns.the temporary object is destroyed and theThe implementation may then deallocate the memory for thetemporaryexception object; any such deallocation is done in an unspecified way.The destruction occurs immediately after the destruction of the object declared in the exception-declaration in the handler.