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
[intro.object]/1 Turn non-normative wording into a Note; remove incorrect wording. #4490
Conversation
Remove incorrect wording
I think our current object model in C++ is that each object has a type; if the expression used to access the object doesn't fit, it's undefined behavior (except for the aliasing exceptions). I agree the note appears to say something else. |
Editorial meeting 2021-04-16: Looks good. |
How does this change address the aliasing exceptions? |
How so? Please look at the actual change. |
This change has removed the confusing (and incorrect) wording "For other objects, the interpretation of the values found therein is determined by the type of the \grammarterm{expression}{s}\iref{expr.compound} used to access them." This (also given the StackOverflow discussion) appears to be a net improvement. |
OK, I see that the wording of [expr.reinterpret.cast] that caused the StackOverflow discussion has also changed since then, so I remove my objection. |
The wording has been changed to take into account pointer-interconvertibility. For non-pointer-interconvertible objects (as in the SO question), the new wording has the same meaning as the old wording. |
That might have been the intent. However, it also moved some otherwise objectionable wording from the normative part into a note and arguably reduced its scope. Otherwise, adding yet another case to the use of the language that is formally UB but practically IDB is hardly an improvement. |
I wonder, if P1839 would be approved, Is that something is necessary to be clarified by the wording that has been a note by this thread. Probably not, Maybe we can use pointer-interconvertible to interpret that. Cancel the normative for the wording can make an object always constantly; Regardless of what the type of a "glvalue" that refers to the object is, it always has the same value as if the type is the dynamic type of that object. |
The last sentence looks just wrong: the type of the expression doesn't affect the value of the objects.
The second to last sentence doesn't look normative, it looks like a typical implementation strategy description.
Fixes #2308