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

2024-10-26


1296. Ill-formed template declarations (not just definitions)

Section: 13.8  [temp.res]     Status: CD3     Submitter: Nikolay Ivchenkov     Date: 2011-04-14

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

According to 13.8 [temp.res] paragraph 8,

Knowing which names are type names allows the syntax of every template definition to be checked. No diagnostic shall be issued for a template definition for which a valid specialization can be generated. If no valid specialization can be generated for a template definition, and that template is not instantiated, the template definition is ill-formed, no diagnostic required. If every valid specialization of a variadic template requires an empty template parameter pack, the template definition is ill-formed, no diagnostic required. If a type used in a non-dependent name...

It seems that these points could and should apply to template declarations that are not definitions, as well.

Proposed resolution (August, 2011):

Change 13.8 [temp.res] paragraph 8 as follows:

Knowing which names are type names allows the syntax of every template definition to be checked. No diagnostic shall be issued for a template definition for which a valid specialization can be generated. If no valid specialization can be generated for a template definition, and that template is not instantiated, the template definition is ill-formed, no diagnostic required. If every valid specialization of a variadic template requires an empty template parameter pack, the template definition is ill-formed, no diagnostic required. If a type used...