You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full name of submitter (unless configured in github; will be published with the issue): Jim X
[class.mfct.non.static] p2 says:
When an id-expression ([expr.prim.id]) that is neither part of a class member access syntax ([expr.ref]) nor the unparenthesized operand of the unary & operator ([expr.unary.op]) is used where the current class is X ([expr.prim.this]), ..., the id-expression is transformed into a class member access expression ([expr.ref]) using (*this) as the postfix-expression to the left of the . operator.
Consider this case:
structA{
int a;
voidshow(){
int* r = &a; // #1
}
};
According to [class.mfct.non.static] p2, id-expression a(especially, unqualified-id) is the operand of the unary & operand, hence the transformation shouldn't apply to this case, however, all implementations accept this example.
Suggested Resolution
We may want to say
When an id-expression ([expr.prim.id]) that is neither:
part of a class member access syntax ([expr.ref]), nor
the unparenthesized operand of the unary & operator ([expr.unary.op]) if the id-expression is an qualified-id