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


1922. Injected class template names and default arguments

Section: 13.8.2  [temp.local]     Status: CD4     Submitter: Hubert Tong     Date: 2014-05-05

[Moved to DR at the May, 2015 meeting.]

Use of the injected-class-name of a class template with a template-argument-list that relies on default arguments is not clearly specified in the current wording of the Standard. In particular, according to 13.2 [temp.param] paragraph 10,

The set of default template-arguments available for use with a template declaration or definition is obtained by merging the default arguments from the definition (if in scope) and all declarations in scope in the same way default function arguments are (9.3.4.7 [dcl.fct.default]).

However, the injected-class-name hides the template declarations, so it is not clear whether the default arguments are available at that point or not.

Proposed resolution (November, 2014):

Change 13.2 [temp.param] paragraph 10 as follows:

The set of default template-arguments available for use with a template declaration or definition is obtained by merging the default arguments from the definition (if in scope) and all prior declarations in scope of the template in the same way default function arguments are (9.3.4.7 [dcl.fct.default]). [Example:...