7
Expressions
[expr]
7.5
Primary expressions
[expr.prim]
7.5.4
Names
[expr.prim.id]
7.5.4.3
Qualified names
[expr.prim.id.qual]
qualified-id
:
nested-name-specifier
template
o
p
t
unqualified-id
nested-name-specifier
:
::
type-name
::
namespace-name
::
decltype-specifier
::
nested-name-specifier
identifier
::
nested-name-specifier
template
o
p
t
simple-template-id
::
1
#
The type denoted by a
decltype-specifier
in a
nested-name-specifier
shall be a class or enumeration type
.
2
#
A
nested-name-specifier
that denotes a class, optionally followed by the keyword
template
(
[temp.
names]
), and then followed by the name of a member of either that class (
[class.
mem]
) or one of its
base classes
, is a
qualified-id
;
[class.
qual]
describes name lookup for class members that appear in
qualified-id
s
.
The result is the member
.
The type of the result is the type of the member
.
The result is an lvalue if the member is a static member function or a data member and a prvalue otherwise
.
[
Note
1
:
A class member can be referred to using a
qualified-id
at any point in its potential scope (
[basic.
scope.
class]
)
.
—
end note
]
Where
type-name
::
~
type-name
is used, the two
type-name
s
shall refer to the same type (ignoring cv-qualifications); this notation denotes the destructor of the type so named (
[expr.
prim.
id.
dtor]
)
.
The
unqualified-id
in a
qualified-id
shall not be of the form
~
decltype-specifier
.
3
#
The
nested-name-specifier
::
names the global namespace
.
A
nested-name-specifier
that names a namespace (
[basic.
namespace]
), optionally followed by the keyword
template
(
[temp.
names]
), and then followed by the name of a member of that namespace (or the name of a member of a namespace made visible by a
using-directive
), is a
qualified-id
;
[namespace.
qual]
describes name lookup for namespace members that appear in
qualified-id
s
.
The result is the member
.
The type of the result is the type of the member
.
The result is an lvalue if the member is a function, a variable, or a structured binding (
[dcl.
struct.
bind]
) and a prvalue otherwise
.
4
#
A
nested-name-specifier
that denotes an
enumeration
, followed by the name of an enumerator of that enumeration, is a
qualified-id
that refers to the enumerator
.
The result is the enumerator
.
The type of the result is the type of the enumeration
.
The result is a prvalue
.
5
#
In a
qualified-id
, if the
unqualified-id
is a
conversion-function-id
, its
conversion-type-id
is first looked up in the class denoted by the
nested-name-specifier
of the
qualified-id
and the name, if found, is used
.
Otherwise, it is looked up in the context in which the entire
qualified-id
occurs
.
In each of these lookups, only names that denote types or templates whose specializations are types are considered
.