14 Templates [temp]

14.6 Name resolution [temp.res]

14.6.2 Dependent names [temp.dep]

14.6.2.3 Value-dependent expressions [temp.dep.constexpr]

Except as described below, a constant expression is value-dependent if any subexpression is value-dependent.

An identifier is value-dependent if it is:

  • a name declared with a dependent type,

  • the name of a non-type template parameter,

  • a constant with literal type and is initialized with an expression that is value-dependent.

Expressions of the following form are value-dependent if the unary-expression or expression is type-dependent or the type-id is dependent:

sizeof unary-expression
sizeof ( type-id )
typeid ( expression )
typeid ( type-id )
alignof ( type-id )
noexcept ( expression )

Note: For the standard library macro offsetof, see [support.types]. — end note ]

Expressions of the following form are value-dependent if either the type-id or simple-type-specifier is dependent or the expression or cast-expression is value-dependent:

simple-type-specifier ( expression-listopt )
static_cast < type-id > ( expression )
const_cast < type-id > ( expression )
reinterpret_cast < type-id > ( expression )
( type-id ) cast-expression

Expressions of the following form are value-dependent:

sizeof ... ( identifier )

An id-expression is value-dependent if it names a member of an unknown specialization.