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
When an id-expression ([expr.prim.id]) that is not part of a class member access syntax ([expr.ref]) and not used to form a pointer to member ([expr.unary.op]) is used where the current class is X ([expr.prim.this]), if name lookup ([basic.lookup]) resolves the name in the id-expression to a non-static non-type member of some class C, and if either the id-expression is potentially evaluated or C is X or a base class of X, 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 example
structB{
int d;
voidshow(decltype(d)); // #1
};
the name d in #1 resolves to the non-static data member of B, the current class is also B, hence the id-expression is transformed into a class member access expression, however, according to [expr.prim.this] p5
The expression this shall not appear in any other context.
The transformation makes an ill-formed.
The text was updated successfully, but these errors were encountered:
[class.mfct.non-static] p3
Consider this example
the name
d
in#1
resolves to the non-static data member of B, the current class is also B, hence the id-expression is transformed into a class member access expression, however, according to [expr.prim.this] p5The transformation makes an ill-formed.
The text was updated successfully, but these errors were encountered: