-
Notifications
You must be signed in to change notification settings - Fork 795
[ub,intro.progress] Added entry for UB due to lack of forward progress #8335
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
Open
timuraudio
wants to merge
1
commit into
cplusplus:ub-ifndr
Choose a base branch
from
timuraudio:ub-ifndr
base: ub-ifndr
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+25
−2
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to add to the explicitly called out phrases at the beginning of [ub.general]:
draft/source/ub.tex
Lines 6 to 9 in f489b81
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! I get where you are coming from, but I'm not sure it makes sense in this case.
The fact that the UB in [intro.progress] is not called out using one of the phrases listed in [ub.general] is a wording defect which is going to be fixed by CWG2816. So I think we should leave the list of phrases in [ub.general] as-is and instead just apply the proposed resolution in CWG2816, which will change [intro.progress] to explicitly say "the behavior is undefined" instead of "the implementation may assume".
Would that be an acceptable course of action for you?
We just need to make sure that when the wording in [intro.progress] is fixed, the merge conflict between that fix and this PR will be resolved in a way that doesn't accidentally drop the new
\ubdef
.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a little bit weird for [ub.general] to be in contradiction [ub.intro.progress], even if it's temporary. If you do add the phrase to [ub.general] then it can always be removed when CWG2816 eventually gets resolved. This could be recorded under the proposed resolution of CWG2816, so it does not get forgotten.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with that approach is that the phrase "the implementation may assume..." does not normally mean "otherwise the behaviour is undefined". The phrase, or variations of it, occur about a dozen times in the Standard, but [intro.progress] is actually the only place where it means "otherwise the behaviour is undefined". In other places, it means things like "we will ignore this case" (e.g., [over.call.func]/2), "we will treat this case as the default" (e.g., [class.access.base]/2), etc.
Since none of the other occurrences of the phrase imply that there is UB, adding the phrase to [ub.general] as you suggest seems outright wrong and I don't think we should do that, not even temporarily.
In other words, yes it seems a little bit weird for [ub.general] to be in contradiction of [ub.intro.progress], but if we add the phrase to [ub.general] as you suggest, then instead it will be in conctradiction with a bunch of other places, and in a way that seems worse (suggesting that there is UB where there is none).
Is there any other resolution that you can live with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can live with the PR as is, I am not going to die on this hill.
Another option would be to make it clear in [ub.general] that the list of phrases there are not exhaustive.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the list non-exhaustive loses the important property that people can reason about when the text of the Standard means "this is explicit UB" and when it doesn't. Defining a closed set of phrases (and fixing any wording that doesn't use those phrases correctly) is much more useful here in my opinion than defining an open set as you suggest.
We now have a closed set of phrases in [ub.general], and we have one instance of UB that is inconsistent with that in [intro.progress]. So I think the best approach is to fix that one inconsistency by adopting CWG2816 and to move on, not to water down the UB Annex wording or make it more ambiguous (even if temporarily).
So my preference remains to merge this PR as-is, but I am happy for Jens to make the call.