Skip to content

Commit a409db7

Browse files
burblebeetkoeppe
authored andcommitted
CWG3240 Return object destruction from throwing postcondition evaluation
1 parent bd2deb7 commit a409db7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎source/exceptions.tex‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,11 @@
395395
Each object with automatic storage duration is destroyed if it has been
396396
constructed, but not yet destroyed,
397397
since the try block was entered.
398-
If an exception is thrown during the destruction of temporaries or
399-
local variables for a \keyword{return} statement\iref{stmt.return},
398+
If the destruction of temporaries or local variables
399+
for a \keyword{return} statement\iref{stmt.return} or
400+
the evaluation of postcondition assertions of
401+
the enclosing function\iref{expr.call}
402+
exits via an exception,
400403
the destructor for the returned object (if any) is also invoked.
401404
The objects are destroyed in the reverse order of the completion
402405
of their construction.

0 commit comments

Comments
 (0)