Open hubert-reinterpretcast opened 1 month ago
I believe this also means that all i
declared with decltype(auto)
in P
can be deduced from the corresponding non-type template argument for the specialization from A
.
template <decltype(auto)> struct A;
template <auto x> long *f(A<x> *); // #1
template <decltype(auto) x> short *f(A<x> *); // #2
const int i = 0;
short *g(A<(i)> *ap) { return f(ap); } // OK, only #2 matches
long *g(A<i> *ap) { return f(ap); } // OK, #1 is more specialized
CWG2900
Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong
Reference (section label): [temp.deduct.type]
Link to reflector thread (if any): N/A
Issue description: https://wg21.link/temp.deduct.type#20 has
This wording does not address what happens when the declared type of
i
is a placeholder type: the corresponding template argument can be read as beingi
(and the placeholder type deduction process would then be circular).This wording also does not address what happens when the type of the corresponding template parameter of the template named by the enclosing simple-template-id is a placeholder type.
Suggested resolution:
Examples: Template parameter of the template named by the enclosing simple-template-id is
auto
ordecltype(auto)
:i
is declared withauto
:i
is declared withdecltype(auto)
: