-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CWG2944 [expr.throw] Throw expressions should be indivisible #626
Comments
Consider I wonder whether the current wording even allows partial side effect on a memory location during throwing. Perhaps this also needs to be disallowed if it's not so. |
I have considered this, and similar to Once the program constructs an exception, it is already on a path towards throwing it, and little or nothing can be gained from doing something else first (nor does it seem like the user would ever except that to happen). Also, this is all purely hypothetical because |
Reference (section label): [expr.throw]
Issue description
It is unclear what happens when two throw-expressions are unsequenced, such as in:
As per [except.throw] paragraph 1, this results in two unsequenced transfers of control to the caller, contrary to
co_await
expressions, which are indivisible and non-interleavable following CWG2466 ([intro.execution] paragraph 11).Suggested resolution
Update [intro.execution] paragraph 11 as follows:
Analogous to [expr.await] Note 2, append a note to [expr.throw] paragraph 2 as follows:
The text was updated successfully, but these errors were encountered: