Created on 2026-08-25.00:00:00 last changed 5 days ago
Proposed resolution (approved by CWG 2026-10-16):
Change in 14.3 [except.ctor] paragraph 2 as follows:
Each object with automatic storage duration is destroyed if it has been constructed, but not yet destroyed, since the try block was entered. If an exception is thrown during the destruction of temporaries or local variables for a return statement (8.8.4 [stmt.return]), or from the evaluation of postcondition assertions of the enclosing function (7.6.1.3 [expr.call]), the destructor for the returned object (if any) is also invoked. The objects are destroyed in the reverse order of the completion of their construction. [ Example: ... ]
(From submission #988.)
The return object is created while evaluating a return statement. It needs to be destroyed when a later evaluation in that same function exits via an exception, i.e. destruction of temporaries or local variables (already covered). The consideration of an exception thrown from a postcondition evaluation is missing.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-10-16 19:06:14 | admin | set | status: open -> tentatively ready |
| 2026-10-11 20:43:03 | admin | set | messages: + msg8707 |
| 2026-08-25 00:00:00 | admin | create | |