This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[Adopted at the February, 2016 meeting.]
The rationale for the restriction in 13.7.6.1 [temp.spec.partial.general] bullet 9.1 is not clear:
A partially specialized non-type argument expression shall not involve a template parameter of the partial specialization except when the argument expression is a simple identifier. [Example:
template <int I, int J> struct A {}; template <int I> struct A<I+5, I*2> {}; // error template <int I, int J> struct B {}; template <int I> struct B<I, I> {}; // OK
—end example]
In the example, it's clear that I is non-deducible, but this rule prevents plausible uses like:
template <int I, int J> struct A {}; template <int I> struct A<I, I*2> {};
(See also issues 1647, 2033, and 2127.)
Proposed resolution (September, 2015):
Change 13.7.6.1 [temp.spec.partial.general] bullet 9.1 as follows:
A partially specialized non-type argument expression shall
not involve a template parameter of the partial specialization except when
the argument expression is a
simple identifier. Each template-parameter shall
appear at least once in the template-id outside a non-deduced
context. [Example:
template <int I, int J> struct A {}; template <int I> struct A<I+5, I*2> {}; // errortemplate <int I, int J> struct B {};template <int I> structBA<I, I> {}; // OK template <int I, int J, int K> struct B {}; template <int I> struct B<I, I*2, 2> {}; // OK
—end example]