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

2023-02-07


1096. Missing requirement for template definitions

Section: Clause 13  [temp]     Status: C++11     Submitter: Daniel Krügler     Date: 2010-07-28

[Voted into the WP at the March, 2011 meeting.]

The removal of the export keyword inadvertently deleted the text (previously found in Clause 13 [temp] paragraph 8 of the 2003 Standard),

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.

This requirement must be reinstated.

Proposed resolution (January, 2011):

Add the following as a new paragraph following Clause 13 [temp] paragraph 5:

A function template, member function of a class template, or static data member of a class template shall 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.