This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2023-01-15


32. Clarification of explicit instantiation of non-exported templates

Section: Clause 13  [temp]     Status: TC1     Submitter: Daveed Vandevoorde     Date: 10 Jul 1998

Section Clause 13 [temp] paragraph 8 says:

A non-exported template that is neither explicitly specialized nor explicitly instantiated must be defined in every translation unit in which it is implicitly instantiated (13.9.2 [temp.inst] ) or explicitly instantiated (13.9.3 [temp.explicit] ); no diagnostic is required.
Shouldn't the first underlined phrase be omitted to avoid conflict with the second underlined phrase?

From John Spicer:

The first "explicitly instantiated" is intended to mean "explicitly instantiated in some other translation unit".

Proposed Resolution (04/99): Change the text in Clause 13 [temp] paragraph 8 from:

A non-exported template that is neither explicitly specialized nor explicitly instantiated must be defined in every translation unit in which it is implicitly instantiated (13.9.2 [temp.inst] ) or explicitly instantiated (13.9.3 [temp.explicit] ); no diagnostic is required.
to:
A non-exported template must be defined in every translation unit in which it is implicitly instantiated (13.9.2 [temp.inst] ), unless the corresponding specialization is explicitly instantiated (13.9.3 [temp.explicit] ) in some translation unit; no diagnostic is required. [Note: See also 13.9.3 [temp.explicit] ]