[temp.dep.expr] (original) (raw)

13 Templates [temp]

13.8 Name resolution [temp.res]

13.8.2 Dependent names [temp.dep]

13.8.2.2 Type-dependent expressions [temp.dep.expr]

Except as described below, an expression is type-dependent if any subexpression is type-dependent.

thisis type-dependent if the class type of the enclosing member function is dependent ([temp.dep.type]).

Anid-expressionis type-dependent if it is not a concept-id and it contains

or if it names a dependent member of the current instantiation that is a static data member of type “array of unknown bound of T” for some T ([temp.static]).

Expressions of the following forms are type-dependent only if the type specified by thetype-id,simple-type-specifierornew-type-idis dependent, even if any subexpression is type-dependent:

simple-type-specifier ( expression-list ) :: new new-placement new-type-id new-initializer :: new new-placement ( type-id ) new-initializer dynamic_­cast < type-id > ( expression ) static_­cast < type-id > ( expression ) const_­cast < type-id > ( expression ) reinterpret_­cast < type-id > ( expression ) ( type-id ) cast-expression

A class member access expression is type-dependent if the expression refers to a member of the current instantiation and the type of the referenced member is dependent, or the class member access expression refers to a member of an unknown specialization.

[ Note

:

In an expression of the formx.yorxp->ythe type of the expression is usually the type of the memberyof the class ofx(or the class pointed to byxp).

However, ifxorxprefers to a dependent type that is not the current instantiation, the type ofyis always dependent.

Ifxor xprefers to a non-dependent type or refers to the current instantiation, the type ofyis the type of the class member access expression.

end note

]

A braced-init-list is type-dependent if any element is type-dependent or is a pack expansion.