-
Notifications
You must be signed in to change notification settings - Fork 771
[csetjmp.syn] CWG2361, LWG3652: Imprecise description of UB #1778
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
Comments
Since "stack unwinding" is only defined in the context of exceptions [except.ctor], I don't understand what exactly the improvement is with your proposal. I do agree that the wording is sub-optimal, but I'm not sure we can find something better that is a small enough fix to be considered editorial. |
The original wording is unclear beacuse it does not exactly explain which |
The meaning seems fairly obvious to me. If non-trivial destructors would be invoked by transferring control from point A to point B by throwing an exception at A and catching it at B, then it's undefined to transfer control from A to B by calling |
@jwakely Then why don't we put your explanation
in place of
in the standard? |
I still find that to have a fundamental problem: we can't throw an exception at the So I agree the wording is wrong. I do not agree that it can be repaired editorially. While technically library wording, this is a core language mechanism, so we probably want CWG to look at this and propose a wording change. |
Filed a core issue. |
This is CWG2361. |
See also LWG3652. |
My understanding is that LWG3652 still doesn't explain how we can "throw an exception at the |
It seems that such UB should be removed in the spirit of CWG2523. But there's still an issue on whether destructor is called on each of these objects. |
It's unclear what does the document mean by "replacing". Could be something like "if ... skips stack unwinding ..."
The text was updated successfully, but these errors were encountered: