Skip to content

Commit 490d0da

Browse files
jensmaurerzygoloid
authored andcommitted
[dcl.dcl,temp.spec] Move normative statements on restrictions for
explicit specializations and explicit instantiations to [temp.spec] and its subsections.
1 parent dd7b519 commit 490d0da

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

source/declarations.tex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,11 @@
356356
\tcode{static}\iref{class.union.anon}). The
357357
\grammarterm{storage-class-specifier} applies to the name declared by each
358358
\grammarterm{init-declarator} in the list and not to any names declared by
359-
other specifiers. A \grammarterm{storage-class-specifier}
360-
other than \tcode{thread_local}
361-
shall not be
362-
specified in an explicit specialization\iref{temp.expl.spec} or an
363-
explicit instantiation\iref{temp.explicit} directive.
359+
other specifiers.
360+
\begin{note}
361+
See \ref{temp.expl.spec} and \ref{temp.explicit} for restrictions
362+
in explicit specializations and explicit instantiations, respectively.
363+
\end{note}
364364

365365
\pnum
366366
\begin{note}
@@ -8441,8 +8441,11 @@
84418441
is not allowed to apply to that
84428442
entity or statement, the program is ill-formed. If an \grammarterm{attribute-specifier-seq}
84438443
appertains to a friend declaration\iref{class.friend}, that declaration shall be a
8444-
definition. No \grammarterm{attribute-specifier-seq} shall appertain to an explicit
8445-
instantiation\iref{temp.explicit}.
8444+
definition.
8445+
\begin{note}
8446+
An \grammarterm{attribute-specifier-seq} cannot appeartain to
8447+
an explicit instantiation\iref{temp.explicit}.
8448+
\end{note}
84468449

84478450
\pnum
84488451
For an \grammarterm{attribute-token}

source/templates.tex

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6213,12 +6213,6 @@
62136213
A member function, member class or static data member of a class template can
62146214
be explicitly instantiated from the member definition associated with its class
62156215
template.
6216-
An explicit instantiation of a
6217-
function template,
6218-
member function of a class template, or
6219-
variable template
6220-
shall not
6221-
use the \tcode{inline}, \tcode{constexpr}, or \tcode{consteval} specifiers.
62226216

62236217
\pnum
62246218
The syntax for explicit instantiation is:
@@ -6232,6 +6226,19 @@
62326226
definition and an explicit instantiation declaration. An explicit instantiation
62336227
declaration begins with the \tcode{extern} keyword.
62346228

6229+
\pnum
6230+
An explicit instantiation shall not use
6231+
a \grammarterm{storage-class-specifier}\iref{dcl.stc}
6232+
other than \keyword{thread_local}.
6233+
An explicit instantiation of a
6234+
function template,
6235+
member function of a class template, or
6236+
variable template
6237+
shall not
6238+
use the \tcode{inline}, \tcode{constexpr}, or \tcode{consteval} specifiers.
6239+
No \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar}
6240+
shall appertain to an explicit instantiation.
6241+
62356242
\pnum
62366243
If the explicit instantiation is for a class or member class, the
62376244
\grammarterm{elaborated-type-specifier} in the \grammarterm{declaration}
@@ -6527,6 +6534,11 @@
65276534
types will be sorted by functions generated from the template.
65286535
\end{example}
65296536

6537+
\pnum
6538+
An explicit specialization shall not use
6539+
a \grammarterm{storage-class-specifier}\iref{dcl.stc}
6540+
other than \keyword{thread_local}.
6541+
65306542
\pnum
65316543
An explicit specialization
65326544
may be declared in any scope in which the corresponding primary template

0 commit comments

Comments
 (0)