[expr.prim.id.unqual] (original) (raw)

[ Note

:

Within the definition of a non-static member function, anidentifier that names a non-static member is transformed to a class member access expression ([class.mfct.non-static]).

end note

]

The result is the entity denoted by the identifier.

If the entity is a local entity and naming it from outside of an unevaluated operand within the declarative region where the unqualified-id appears would result in some intervening lambda-expressioncapturing it by copy ([expr.prim.lambda.capture]), the type of the expression is the type of a class member access expression ([expr.ref]) naming the non-static data member that would be declared for such a capture in the closure object of the innermost such intervening lambda-expression.

[ Note

:

If that lambda-expression is not declared mutable, the type of such an identifier will typically be const qualified.

end note

]

The type of the expression is the type of the result.

[ Note

:

If the entity is a template parameter object for a template parameter of type T ([temp.param]), the type of the expression is const T.

end note

]

[ Note

:

The type will be adjusted as described in [expr.type]if it is cv-qualified or is a reference type.

end note

]

The expression is an lvalue if the entity is a function, variable, structured binding ([dcl.struct.bind]), data member, or template parameter object and a prvalue otherwise ([basic.lval]); it is a bit-field if the identifier designates a bit-field.

[ Example

:

void f() { float x, &r = x; [=] { decltype(x) y1;
decltype((x)) y2 = y1;

decltype(r) r1 = y1;        
decltype((r)) r2 = y2;      

}; }

end example

]