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

CWG2949 [temp.func.order] p6 Partial ordering rules don't take ellipsis into account #632

Open
ddvamp opened this issue Nov 2, 2024 · 3 comments

Comments

@ddvamp
Copy link

ddvamp commented Nov 2, 2024

Full name of submitter: Artyom Kolpakov

Reference (section label): [temp.func.order] p6

Issue description: Firstly, the standard does not formally define what the length of the template-parameter-list is. This probably means the number of template-parameter.
Secondly, it is unclear what a function parameter list is. I suppose that means parameter-type-list. It is also unclear how its length is determined. This is the number of parameters only, or the ellipsis is also counted. Here and further, I omit the function parameter pack because according to CWG2942 it is proposed to remove it from the definition of parameter-type-list.
Then, in clauses (6.2.1.2.2) and (6.2.2) it is unclear what the positionally correspond for parameters mean when parameter corresponds to ellipsis. I don't see a specific clause, however, this example says that ellipsis is not a parameter, so you can think in two ways: the first, because there is no positionally corresponding parameter, their types cannot match; the second, because there is no positionally corresponding parameter, their types do not need to be checked (It's like unfolding empty packs for || and &&). But what happens if several parameters positionally correspond to ellipsis.

If ellipsis is not taken into account, it looks like [temp.func.order] p6 implies that parameter-type-lists must be the same in order to be checked against constraints. Also [over.match.best.general] p2.6 talks about the same (non-object-)parameter-type-lists (with some reservations).

Suggested resolution: Edit [temp.func.order] p6.1:

If their template-parameter-lists (possibly including template-parameters invented for an abbreviated function template ([dcl.fct])) contain a different number of template-parameters, or if their function parameter lists differ in length parameter-type-lists contain a different number of function parameters, or if exactly one of the templates contains an ellipsis, neither template is more specialized than the other.

@jensmaurer
Copy link
Member

CWG2949

@jensmaurer jensmaurer changed the title [temp.func.order] p6 Partial ordering rules don't take ellipsis into account CWG2949 [temp.func.order] p6 Partial ordering rules don't take ellipsis into account Nov 3, 2024
@jwakely
Copy link
Member

jwakely commented Nov 4, 2024

@jensmaurer the new issue says it's from submission 631 but this is #632

@jensmaurer
Copy link
Member

@jwakely Thanks, fixed.

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

3 participants