cplusplus/draft

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

Opened this issue · 1 comments

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.

[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.