|
127 | 127 | \end{note} |
128 | 128 |
|
129 | 129 | \pnum |
130 | | -In a |
131 | | -\grammarterm{template-declaration}, |
132 | | -explicit specialization, or explicit instantiation the |
133 | | -\grammarterm{init-declarator-list} |
134 | | -in the declaration shall contain at most one declarator. |
135 | | -When such a declaration is used to declare a class template, |
136 | | -no declarator is permitted. |
| 130 | +A \grammarterm{template-declaration} or \grammarterm{explicit-specialization} |
| 131 | +declares a class or a class template if its \grammarterm{declaration} contains no |
| 132 | +\grammarterm{declarator} and it does not declare an alias template\iref{temp.alias} or |
| 133 | +deduction guide\iref{temp.deduct.guide}; the \grammarterm{decl-specifier-seq} of such a |
| 134 | +declaration shall contain a single \grammarterm{defining-type-specifier} that is either |
| 135 | +a \grammarterm{class-specifier}, \grammarterm{enum-specifier}, or an \grammarterm{elaborated-type-specifier}. |
| 136 | +An \grammarterm{explicit-instantiation} that contains no \grammarterm{declarator} |
| 137 | +is an explicit instantiation of a class; such a declaration shall contain an |
| 138 | +\grammarterm{elaborated-type-specifier}, itself containing a \grammarterm{simple-template-id}. |
| 139 | + |
| 140 | +\pnum |
| 141 | +A \grammarterm{template-declaration} or \grammarterm{explicit-specialization} |
| 142 | +shall contain a single \grammarterm{declarator} if it does not declare a class, |
| 143 | +class template, concept\iref{temp.concept}, alias template\iref{temp.alias} or |
| 144 | +deduction guide\iref{temp.deduct.guide}. Similarly, an \grammarterm{explicit-instantiation} |
| 145 | +that does not explicitly instantiate a class shall contain a single \grammarterm{declarator}. |
| 146 | + |
| 147 | +\pnum |
| 148 | +A \grammarterm{template-declaration} or \grammarterm{explicit-specialization} containing |
| 149 | +a \grammarterm{declarator} that does not declare a variable or variable template declares |
| 150 | +a function or function template. Similarly, an \grammarterm{explicit-instantiation} containing |
| 151 | +a \grammarterm{declarator} that does not explicitly instantiate a variable is an explicit |
| 152 | +instantiation of a function. |
137 | 153 |
|
138 | 154 | \pnum |
139 | 155 | \indextext{template name!linkage of}% |
|
6561 | 6577 | \pnum |
6562 | 6578 | An explicit instantiation shall not use |
6563 | 6579 | a \grammarterm{storage-class-specifier}\iref{dcl.stc} |
6564 | | -other than \keyword{thread_local}. |
| 6580 | +other than \keyword{thread_local}. The \grammarterm{init-declarator} |
| 6581 | +of an explicit instantiation (if any) shall not contain an \grammarterm{initializer}. |
6565 | 6582 | An explicit instantiation of a |
6566 | 6583 | function template, |
6567 | 6584 | member function of a class template, or |
|
6572 | 6589 | shall appertain to an explicit instantiation. |
6573 | 6590 |
|
6574 | 6591 | \pnum |
6575 | | -If the explicit instantiation is for a class or member class, the |
6576 | | -\grammarterm{elaborated-type-specifier} in the \grammarterm{declaration} |
6577 | | -shall include a \grammarterm{simple-template-id}; |
6578 | | -otherwise, the \grammarterm{declaration} |
6579 | | -shall be a \grammarterm{simple-declaration} whose \grammarterm{init-declarator-list} |
6580 | | -comprises a single \grammarterm{init-declarator} |
6581 | | -that does not have an \grammarterm{initializer}. |
6582 | 6592 | If the explicit instantiation is for |
6583 | 6593 | a function or member function, |
6584 | 6594 | the |
|
0 commit comments