Does the standard mandate an lvalue-to-rvalue conversion of the pointer variable when applying indirection?

I think you’re approaching this from a rather oblique angle, so to speak. According to §5.3.1/1:

The unary * operator performs indirection: the expression to which it is applied shall be a pointer to an
object type, or a pointer to a function type and the result is an lvalue referring to the object or function
to which the expression points. If the type of the expression is “pointer to T,” the type of the result is “T.”

Although this doesn’t talk about the lvalue-to-rvalue conversion, it requires that the expression be a pointer to an object or function. An uninitialized pointer won’t (except, perhaps by accident) be any such thing so the attempt at dereferencing gives undefined behavior.

Leave a Comment