[expr.prim.id.qual] (original) (raw)
7 Expressions [expr]
7.5 Primary expressions [expr.prim]
7.5.5 Names [expr.prim.id]
7.5.5.3 Qualified names [expr.prim.id.qual]
A declaration that uses a declarative nested-name-specifiershall be a friend declaration or inhabit a scope that contains the entity being redeclared or specialized.
The nested-name-specifier :: nominates the global namespace.
If a nested-name-specifier Nis declarative and has a simple-template-id with a template argument list Athat involves a template parameter, let T be the template nominated by N without A.
T shall be a class template.
- Otherwise, N nominates the partial specialization ([temp.spec.partial]) of Twhose template argument list is equivalent to A ([temp.over.link]); the program is ill-formed if no such partial specialization exists.
If the nested-name-specifier is not declarative, the entity shall not be a template.
If Q appears in the predicate of a contract assertion C ([basic.contract]) and the entity is
- a variable declared outside of Cof object type T,
- a variable declared outside of Cof type “reference to T”, or
- a structured binding of type Twhose corresponding variable is declared outside of C,
then the type of the expression is const T.
Otherwise, the type of the expression is the type of the result.
The result is an lvalue if the member is
- a function other than a non-static member function,
- a non-static member function if Q is the operand of a unary & operator,
- a variable,
- a structured binding ([dcl.struct.bind]), or
- a data member,
and a prvalue otherwise.