[temp.dep.constexpr] (original) (raw)
13 Templates [temp]
13.8 Name resolution [temp.res]
13.8.3 Dependent names [temp.dep]
13.8.3.4 Value-dependent expressions [temp.dep.constexpr]
Except as described below, an expression used in a context where a constant expression is required is value-dependent if any subexpression is value-dependent.
Anid-expressionis value-dependent if
- it is a concept-id and its concept-name is dependent or any of its arguments are dependent ([temp.dep.temp]),
- it is type-dependent,
- it is the name of a constant template parameter,
- it names a static data member that is a dependent member of the current instantiation and is not initialized in a member-declarator,
- it names a static member function that is a dependent member of the current instantiation, or
- it names a potentially-constant variable ([expr.const]) that is initialized with an expression that is value-dependent.
Expressions of the following form are value-dependent:
unless the identifier is a structured binding pack whose initializer is not dependent.
An expression of the form &qualified-id where thequalified-id names a dependent member of the current instantiation is value-dependent.
An expression of the form &cast-expressionis also value-dependent if evaluating cast-expressionas a core constant expression succeeds and the result of the evaluation refers to a templated entity that is an object with static or thread storage duration or a member function.