Created on 2009-03-03.00:00:00 last changed 178 months ago
[Voted into WP at March, 2010 meeting.]
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.5.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.
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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | messages: + msg2746 |
2010-03-29 00:00:00 | admin | set | status: ready -> cd2 |
2009-11-08 00:00:00 | admin | set | status: review -> ready |
2009-09-29 00:00:00 | admin | set | messages: + msg2308 |
2009-09-29 00:00:00 | admin | set | status: drafting -> review |
2009-08-03 00:00:00 | admin | set | status: open -> drafting |
2009-03-03 00:00:00 | admin | create |