Closed xmh0511 closed 10 months ago
I'm not seeing a problem.
You quoted [over.over] p3:
The specialization, if any, generated by template argument deduction ([temp.over],
Since template argument deduction failed, no specialization was generated, and thus nothing is added to the candidate set. The "if any" explicitly acknowledges the possibility of failure.
If some compilers reject, please post bug reports to them.
The "if any" explicitly acknowledges the possibility of failure.
If "if any" can clearly convey the meaning, the phrasing does not need to reference to [temp.over] because the deduction can also fail in the function template call context.
So, do you claim the cross-reference to [temp.over] shouldn't be there, because it refers to a function call situation?
So, do you claim the cross-reference to [temp.over] shouldn't be there, because it refers to a function call situation?
I meant "if any" may not be clear to apply to the case when template argument deduction fails. It may mean there is no template function. The argument is, that we have [temp.over] to specify that the function won't be added to the candidate set if the deduction fails, hence, [over.over] should also have a similar formal wording like that.
Full name of submitter (unless configured in github; will be published with the issue): Jim X
Consider this case:
In this case, only MSVC accepts the code. https://godbolt.org/z/KEvKTEaGq.
[over.over] p2 says
[over.over] p3 says:
hence, [temp.over] and [temp.deduct.funcaddr] determine whether the example is ok. [temp.deduct.funcaddr] says
[temp.deduct.type] p2 says
However, except that [temp.over] says that the function tempaltes whose deduction fails are not added to the candidate set, there is no other place say so.
BUT, [temp.over] says
Note the emphasized part, this subclase seems to only applied to the function template call. In this example, the context is the take address of the function template.
Suggested Resolution
[temp.over] should apply to all overload resolution context for the function template.