cplusplus / CWG

Core Working Group
23 stars 7 forks source link

[temp.deduct.call] should reference [temp.deduct.type] to detail how the deduction is performed #567

Open xmh0511 opened 3 days ago

xmh0511 commented 3 days ago

Full name of submitter (unless configured in github; will be published with the issue): Jim X

Consider this example:

#include <iostream>
template<int N>
void fun(std::index_sequence<N>){}
int main(){
   fun(std::make_index_sequence<1>{});
}

The deduction is specified by [temp.deduct.call], however, the deduction fails, and the reason is [temp.deduct.type] p20

If P has a form that contains , and if the type of i differs from the type of the corresponding template parameter of the template named by the enclosing simple-template-id, deduction fails.

[temp.deduct.call] merely specifies the resulting P and A, and how to deduce A from P is detailed in [temp.deduct.type].

Suggested resolution:

Inserting this wording after [temp.deduct.call] p3

Using the resulting types P and A, the deduction is then done as described in [temp.deduct.type].