|
5016 | 5016 | \end{codeblock}
|
5017 | 5017 | \end{example}
|
5018 | 5018 |
|
| 5019 | +\pnum |
| 5020 | +An initializer is dependent if |
| 5021 | +any constituent expression\iref{intro.execution} of the initializer |
| 5022 | +is type-dependent. |
| 5023 | +A placeholder type\iref{dcl.spec.auto.general} is dependent if |
| 5024 | +it designates a type deduced from a dependent initializer. |
| 5025 | + |
| 5026 | +\pnum |
| 5027 | +A placeholder for a deduced class type\iref{dcl.type.class.deduct} |
| 5028 | +is dependent if |
| 5029 | +\begin{itemize} |
| 5030 | +\item |
| 5031 | +it has a dependent initializer, or |
| 5032 | +\item |
| 5033 | +it refers to an alias template |
| 5034 | +that is a member of the current instantiation and |
| 5035 | +whose \grammarterm{defining-type-id} is dependent after |
| 5036 | +class template argument deduction\iref{over.match.class.deduct} |
| 5037 | +and substitution\iref{temp.alias}. |
| 5038 | +\end{itemize} |
| 5039 | + |
| 5040 | +\pnum |
| 5041 | +\begin{example} |
| 5042 | +\begin{codeblock} |
| 5043 | +template<class T, class V> |
| 5044 | +struct S { S(T); }; |
| 5045 | + |
| 5046 | +template<class U> |
| 5047 | +struct A { |
| 5048 | + template<class T> using X = S<T, U>; |
| 5049 | + template<class T> using Y = S<T, int>; |
| 5050 | + void f() { |
| 5051 | + new X(1); // dependent |
| 5052 | + new Y(1); // not dependent |
| 5053 | + } |
| 5054 | +}; |
| 5055 | +\end{codeblock} |
| 5056 | +\end{example} |
| 5057 | + |
5019 | 5058 | \pnum
|
5020 | 5059 | A type is dependent if it is
|
5021 | 5060 | \begin{itemize}
|
|
5038 | 5077 | \item
|
5039 | 5078 | a function type whose exception specification is value-dependent,
|
5040 | 5079 | \item
|
| 5080 | +denoted by a dependent placeholder type, |
| 5081 | +\item |
| 5082 | +denoted by a dependent placeholder for a deduced class type, |
| 5083 | +\item |
5041 | 5084 | denoted by a \grammarterm{simple-template-id}
|
5042 | 5085 | in which either the template name is a template parameter or any of the
|
5043 | 5086 | template arguments is a dependent type or an expression that is type-dependent
|
|
0 commit comments