-
Notifications
You must be signed in to change notification settings - Fork 805
[conv.lval] Fix cross-reference for 'invalid pointer value' #5886
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
Closed
Closed
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
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.
What about here, shouldn't this also refer to basic.stc.general for the definition of "invalid pointer"? Why is basic.compound a good reference?
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.
But [basic.stc.general]/4 specifies how to form an invalid pointer value, while [basic.compound]/3.4 is the definition (so [basic.stc.general]/4 refers to [basic.compound]/3.4).
And I think
in [basic.stc.general]/4 should be better placed in [basic.compound]/3. But [basic.compound]/3 may need to be split because it is too long.
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.
Sorry, could you explain a bit how basic.general is the definition? I don't see "invalid" mentioned in basic.general except for in that list in p3 (which doesn't seem like a definition?) and in notes.
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.
[basic.compound] p3 contains the taxonomy of pointer values. It states "there exists a pointer value that is an invalid pointer value".
[basic.stc.general] p4 tells us about one way how to obtain an invalid pointer value (maybe there are others). It also explains a bit of the semantics of an invalid pointer value, but this should probably be moved elsewhere in the long run. For example, [conv.lval] p3.3 tells us a little more about an invalid pointer value.
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.
Yes, right. In fact, [conv.lval] is the very subject of this PR. I'm not sure where the definition of invald value could be moved to improve the presentation; isn't basic.stc.general a good place? We could just add a cross reference to it from [basic.compound]/(3.4).
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.
Sure, but that's converted to use "operator*" (expr.ref p2 and expr.mptr.oper p3).
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.
Except that we seem to lack normative statements elsewhere.
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.
Yes, the normative wording would have to move somewhere more appropriate.
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.
CWG2822 moves the normative wording "somewhere else", for unrelated reasons.
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.
Shall we wait for that to land then?