Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[temp.deduct.call] lacks the cross-reference to [temp.deduct.type] for describing deduction #5550

Open
xmh0511 opened this issue Jul 5, 2022 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Jul 5, 2022

In [temp.deduct.funcaddr] p1, [temp.deduct.conv] p1, [temp.deduct.partial] p8, and [temp.deduct.decl] p1, they all have a similar wording like:

The deduction is then done as described in [temp.deduct.type].

However, [temp.deduct.call] lacks wording like this. We want the following rules

If type deduction cannot be done for any P/A pair, or if for any pair the deduction leads to more than one possible set of deduced values, or if different pairs yield different deduced values, or if any template argument remains neither deduced nor explicitly specified, template argument deduction fails.

and

If a template parameter is used only in non-deduced contexts and is not explicitly specified, template argument deduction fails.

that are defined in [temp.deduct.type] apply to these cases

template<class T>
void fun(T,T){}

fun(0,0.f); // deduction fail

template<class T, class U>
void show(T, typename U::type){}

show(0,0); // deduction fail

Add the following rule in [temp.deduct.call] p4, by saying

The deduction is done as described in [temp.deduct.type].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant