Skip to content

Commit 252380d

Browse files
author
Dawn Perchik
committed
CWG2260 Explicit specializations of deleted member functions
1 parent 193d707 commit 252380d

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

source/templates.tex

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5635,16 +5635,37 @@
56355635

56365636
\pnum
56375637
The implicit instantiation of a class template specialization causes
5638-
the implicit instantiation of the declarations, but not of the definitions,
5639-
default arguments, or \grammarterm{noexcept-specifier}{s} of the
5640-
class member functions,
5641-
member classes,
5642-
scoped member enumerations,
5643-
static data members,
5644-
member templates, and
5645-
friends; and
5646-
it causes the implicit instantiation of the definitions of
5647-
unscoped member enumerations and member anonymous unions.
5638+
\begin{itemize}
5639+
\item
5640+
the implicit instantiation of the declarations, but not of the definitions,
5641+
of the non-deleted
5642+
class member functions,
5643+
member classes,
5644+
scoped member enumerations,
5645+
static data members,
5646+
member templates, and
5647+
friends; and
5648+
\item
5649+
the implicit instantiation of the definitions of
5650+
deleted member functions,
5651+
unscoped member enumerations, and
5652+
member anonymous unions.
5653+
\end{itemize}
5654+
The implicit instantiation of a class template specialization
5655+
does not cause the implicit instantiation of
5656+
default arguments or \grammarterm{noexcept-specifier}{s}
5657+
of the class member functions.
5658+
\begin{example}
5659+
\begin{codeblock}
5660+
template<class T>
5661+
struct C {
5662+
void f() { T x; }
5663+
void g() = delete;
5664+
};
5665+
C<void> c; // OK, definition of \tcode{C<void>::f} is not instantiated at this point
5666+
template<> void C<int>::g() { } // error: redefinition of \tcode{C<int>::g}
5667+
\end{codeblock}
5668+
\end{example}
56485669
However, for the purpose of determining whether an instantiated redeclaration
56495670
is valid according to~\ref{basic.def.odr} and \ref{class.mem},
56505671
a declaration that corresponds to a definition in the template

0 commit comments

Comments
 (0)