This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Accepted as a DR at the June, 2018 (Rapperswil) meeting.]
There is currently no requirement that asimple-template-idused as aclass-name (Clause 11 [class] paragraph 1) musthave template arguments for every template parameter that does not havea default template argument.
Proposed resolution (March, 2018):
Change _N4868_.6.4.1 [basic.scope.declarative] paragraph 1 as follows:
Every name is introduced in some portion of program text called adeclarative region, which is the largest part of the program in which thatname isvalidvalid, that is, in which thatname may be used as an unqualified name to refer to the same entity. Ingeneral...
Add the following as a new paragraph after 13.3 [temp.names] paragraph 7:
Atemplate-id that names an alias template specialization isatype-name.
Atemplate-id isvalid if
there are at most as many arguments as there are parametersor a parameter is a template parameter pack(13.7.4 [temp.variadic]),
there is an argument for each non-deducible non-pack parameter thatdoes not have a defaulttemplate-argument,
eachtemplate-argument matches the correspondingtemplate-parameter (13.4 [temp.arg]),
substitution of each template argument into the following templateparameters (if any) succeeds, and
if thetemplate-id is non-dependent, the associatedconstraints are satisfied as specified in the next paragraph.
Asimple-template-id shall be valid unless it names afunction template specialization(13.10.3 [temp.deduct]). [Example:
template<class T, T::type n = 0> class X; struct S { using type = int; }; using T1 = X<S, int, int>; // error: too many arguments using T2 = X<>; // error: no default argument for first template parameter using T3 = X<1>; // error: value1 does not match type-parameter using T4 = X<int>; // error: substitution failure for second template parameter using T5 = X<S>; // OK—end example]
Change 13.10.3 [temp.deduct] paragraph 2 as follows, convertingfrom bullets to running text:
When an explicit template argument list is specified, if the
templatearguments are not compatible with the template parameter list or do notresult in a valid function type as described belowgiventemplate-id is invalid (13.3 [temp.names]), typededuction fails.Specifically, the following steps are performed whenevaluating an explicitly specified template argument list with respect to agiven function template:
If the specified template arguments do not match the templateparameters in kind (i.e., type, non-type, template), or if there are morearguments than there are parameters and no parameter is a templateparameter pack, or if there is not an argument for each non-pack parameter,type deduction fails.
If any non-type argument does not match the type of thecorresponding non-type template parameter, and is not convertible to thetype of the corresponding non-type parameter as specified in13.4.3 [temp.arg.nontype], type deduction fails.The specified template argument values are substituted for thecorresponding template parameters as specified below.