Skip to content
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

[basic.indet] has a dangling xref to [conv.lval] #7715

Open
RedBeard0531 opened this issue Feb 27, 2025 · 1 comment
Open

[basic.indet] has a dangling xref to [conv.lval] #7715

RedBeard0531 opened this issue Feb 27, 2025 · 1 comment

Comments

@RedBeard0531
Copy link
Contributor

The last normative sentence of p1 says :

If any bit in the value representation has an indeterminate value, the object has an indeterminate value; otherwise, if any bit in the value representation has an erroneous value, the object has an erroneous value ([conv.lval]).

But [conv.lval] says nothing about indeterminate or erroneous values. Did that content move somewhere else, or is that xref attached to the wrong sentence?

Sidenote: [conv.lval] was the first place I thought to look for the rules for loading uninitialized memory. It may be nice to drop a breadcrumb from there to [basic.indet], eg by placing a note either before or after the p4 note like:

See also [basic.indet] for handling of reads of indeterminate and erroneous values.

@Eisenwave
Copy link
Contributor

[conv.lval] in the paper had the following new wording for lvalue-to-rvalue conversion:

If the result is an erroneous value and the bits in the value representation are not valid for the object's type, the behavior is undefined.

As we've later discovered, this UB can happen without erroneous values, and we now have https://eel.is/c++draft/conv.lval#3.4 in that place.

I think we should add a note which says something like

The behavior of lvalue-to-rvalue conversion for erroneous values can be undefined ([conv.lval]).

This would clarify why we're linking to conv.lval in the first place. Otherwise, we should just delete the cross-reference because it's pretty confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants