int main(){
int a = 0;
auto ptr = &a;
auto&& rf = *ptr;
}
Consider the above code, when glvalue ptr is used to as the operand of unary* operator, Is it be required a lvalue-to-rvalue conversion that would applied for it? I.E, Does the operand of unary* operator expect a prvalue?
Question 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”. [ Note: Indirection through a pointer to an incomplete type (other than cv void) is valid. The lvalue thus obtained can be used in limited ways (to initialize a reference, for example); this lvalue must not be converted to a prvalue, see [conv.lval]. — end note ]
What kind of value categories does operands of unary* operator expect.
Beside this operator, It seems to the most operators in [expr] is not specified what kind of value categories its operands expect.
Whenever a glvalue expression appears as an operand of an operator that expects a prvalue for that operand, the lvalue-to-rvalue, array-to-pointer, or function-to-pointer standard conversions are applied to convert the expression to a prvalue. [ Note: Because cv-qualifiers are removed from the type of an expression of non-class type when the expression is converted to a prvalue, an lvalue expression of type const int can, for example, be used where a prvalue expression of type int is required. — end note ].
The quote above is so unclear.
Question 2:
As aforementioned, the most operators in [expr] is not specified what kind of value categories its operands expect. So It it a defect?