|
136 | 136 | A specialization (explicit or implicit) of one template is
|
137 | 137 | distinct from all specializations of any other template.
|
138 | 138 | A template, a template explicit specialization\iref{temp.expl.spec}, and a class
|
139 |
| -template partial specialization shall not have C linkage. |
| 139 | +template partial specialization shall not have C language linkage. |
140 | 140 | \begin{note}
|
141 | 141 | Default arguments for function templates and for member functions of
|
142 | 142 | class templates are considered definitions for the purpose of template
|
|
145 | 145 |
|
146 | 146 | \pnum
|
147 | 147 | \begin{note}
|
148 |
| -A class cannot have the same name as any other |
| 148 | +A template cannot have the same name as any other |
149 | 149 | name bound in the same scope\iref{basic.scope.scope}, except
|
150 | 150 | that a function template can share a name with non-template
|
151 | 151 | functions\iref{dcl.fct} and/or function templates\iref{temp.over}.
|
|
716 | 716 | \item
|
717 | 717 | that is a terminal name
|
718 | 718 | in a \grammarterm{using-declarator}\iref{namespace.udecl},
|
719 |
| -a \grammarterm{declarator-id}\iref{dcl.meaning}, or |
720 |
| -a type-only context |
| 719 | +in a \grammarterm{declarator-id}\iref{dcl.meaning}, or |
| 720 | +in a type-only context |
721 | 721 | other than a \grammarterm{nested-name-specifier}\iref{temp.res}.
|
722 | 722 | \end{itemize}
|
723 | 723 | \begin{note}
|
|
4206 | 4206 | in an unspecified declaration of $T$ that is or is reachable from $D$ and
|
4207 | 4207 | from which no other declaration of $T$
|
4208 | 4208 | that contains the usage of the name is reachable.
|
4209 |
| -If the name is dependent (as specified in \ref{temp.dep}, |
| 4209 | +If the name is dependent (as specified in \ref{temp.dep}), |
4210 | 4210 | it is looked up for each specialization (after substitution)
|
4211 | 4211 | because the lookup depends on a template parameter.
|
4212 | 4212 | \begin{note}
|
4213 | 4213 | Some dependent names are also looked up during parsing to determine
|
4214 | 4214 | that they are dependent or to interpret following \tcode{<} tokens.
|
4215 | 4215 | Uses of other names might be type-dependent or value-dependent
|
4216 |
| -(\ref{temp.dep.expr}, \ref{temp.dep.constexpr}. |
| 4216 | +(\ref{temp.dep.expr}, \ref{temp.dep.constexpr}). |
4217 | 4217 | A \grammarterm{using-declarator} is never dependent in a specialization and
|
4218 | 4218 | is therefore replaced during lookup for that specialization\iref{basic.lookup}.
|
4219 | 4219 | \end{note}
|
|
4323 | 4323 | \end{example}
|
4324 | 4324 |
|
4325 | 4325 | \pnum
|
4326 |
| -A qualified or unqualified name is said to be in a type-only context |
| 4326 | +\indextext{type-only!context|see{context, type-only}}% |
| 4327 | +A qualified or unqualified name is said to be in |
| 4328 | +a \defnx{type-only context}{context!type-only} |
4327 | 4329 | if it is the terminal name of
|
4328 | 4330 | \begin{itemize}
|
4329 | 4331 | \item a
|
|
4333 | 4335 | \grammarterm{class-or-decltype}, or
|
4334 | 4336 | \item
|
4335 | 4337 | a \grammarterm{type-specifier} of a
|
4336 |
| -\grammarterm{new-type-id}, |
4337 |
| -\grammarterm{defining-type-id}, |
4338 |
| -\grammarterm{conversion-type-id}, |
4339 |
| -\grammarterm{trailing-return-type}, |
4340 |
| -default argument of a \grammarterm{type-parameter}, or |
4341 |
| -\grammarterm{type-id} of a |
| 4338 | +\begin{itemize} |
| 4339 | + \item \grammarterm{new-type-id}, |
| 4340 | + \item \grammarterm{defining-type-id}, |
| 4341 | + \item \grammarterm{conversion-type-id}, |
| 4342 | + \item \grammarterm{trailing-return-type}, |
| 4343 | + \item default argument of a \grammarterm{type-parameter}, or |
| 4344 | + \item \grammarterm{type-id} of a |
4342 | 4345 | \keyword{static_cast},
|
4343 | 4346 | \keyword{const_cast},
|
4344 | 4347 | \keyword{reinterpret_cast}, or
|
4345 | 4348 | \keyword{dynamic_cast}, or
|
| 4349 | +\end{itemize} |
4346 | 4350 | \item a \grammarterm{decl-specifier} of the \grammarterm{decl-specifier-seq} of a
|
4347 | 4351 | \begin{itemize}
|
4348 | 4352 | \item \grammarterm{simple-declaration} or a \grammarterm{function-definition} in namespace scope,
|
|
4666 | 4670 | }
|
4667 | 4671 |
|
4668 | 4672 | template<class B> template<class C> void N::A<B>::g(C) {
|
4669 |
| - B b; // the base class, not the template parameter |
4670 |
| - C c; // the template parameter \tcode{C}, not \tcode{A}'s \tcode{C} |
| 4673 | + B b; // \tcode{B} is the base class, not the template parameter |
| 4674 | + C c; // \tcode{C} is the template parameter, not \tcode{A}'s \tcode{C} |
4671 | 4675 | }
|
4672 | 4676 | \end{codeblock}
|
4673 | 4677 | \end{example}
|
|
4720 | 4724 | is a \grammarterm{template-id} in which any of the template arguments depends
|
4721 | 4725 | on a template parameter.
|
4722 | 4726 | \end{itemize}
|
4723 |
| -The component name of an \grammarterm{unqualified-id} is dependent if |
| 4727 | +The component name of an \grammarterm{unqualified-id}\iref{expr.prim.id.unqual} |
| 4728 | +is dependent if |
4724 | 4729 | \begin{itemize}
|
4725 | 4730 | \item
|
4726 | 4731 | it is a \grammarterm{conversion-function-id}
|
|
4787 | 4792 | \item
|
4788 | 4793 | in the definition of a partial specialization
|
4789 | 4794 | or a member of a partial specialization, the name of
|
4790 |
| -the class template followed by the template argument list |
| 4795 | +the class template followed by a template argument list |
4791 | 4796 | equivalent to that of the partial specialization\iref{temp.class.spec}
|
4792 | 4797 | enclosed in \tcode{<>} (or an equivalent template alias specialization).
|
4793 | 4798 | \end{itemize}
|
|
4883 | 4888 | if
|
4884 | 4889 | \begin{itemize}
|
4885 | 4890 | \item
|
4886 |
| -its lookup context, if it is a \grammarterm{qualified name}, |
| 4891 | +its lookup context, if it is a qualified name, |
4887 | 4892 | is the current instantiation, and
|
4888 | 4893 | \item
|
4889 | 4894 | lookup for it finds any member of a class that is the current instantiation
|
|
4950 | 4955 | \pnum
|
4951 | 4956 | If, for a given set of template arguments, a specialization of a template is
|
4952 | 4957 | instantiated that refers to a member of the current instantiation with a
|
4953 |
| -qualified name, the name in is looked up in the |
| 4958 | +qualified name, the name is looked up in the |
4954 | 4959 | template instantiation context. If the result of this lookup differs from the
|
4955 | 4960 | result of name lookup in the template definition context, name lookup is
|
4956 | 4961 | ambiguous.
|
|
5936 | 5941 | \pnum
|
5937 | 5942 | An implementation shall not implicitly instantiate a function template,
|
5938 | 5943 | a variable template,
|
5939 |
| -a member template, a non-virtual member function, or a member class or |
| 5944 | +a member template, a non-virtual member function, a member class or |
5940 | 5945 | static data member of a templated class, or a substatement of a constexpr if
|
5941 | 5946 | statement\iref{stmt.if}, unless such instantiation is required.
|
5942 | 5947 | \begin{note}
|
|
0 commit comments