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

[expr.ref]/(6.3.2) function type spelling doesn't match [dcl.fct]/1 #3607

Closed
languagelawyer opened this issue Jan 6, 2020 · 3 comments · Fixed by #3624
Closed

[expr.ref]/(6.3.2) function type spelling doesn't match [dcl.fct]/1 #3607

languagelawyer opened this issue Jan 6, 2020 · 3 comments · Fixed by #3624
Assignees

Comments

@languagelawyer
Copy link
Contributor

languagelawyer commented Jan 6, 2020

[expr.ref]/(6.3.2) says:

Otherwise, if E1.E2 refers to a non-static member function and the type of E2 is “function of parameter-type-list cv ref-qualifieropt returning T”… The type of E1.E2 is “function of parameter-type-list cv returning T”.

However, this doesn't match how function types are spelled in [dcl.fct]/1:

… the type of the declarator-id in D is “derived-declarator-type-list noexceptopt function of (parameter-declaration-clause) cv-qualifier-seqopt ref-qualifieropt returning T” …

[expr.ref]/(6.3.2):

  • uses cv instead of cv-qualifier-seqopt
  • uses "parameter-type-list" instead of "(parameter-declaration-clause)"
  • misses noexceptopt

Also, why ref-qualifieropt ofE2's type is missing in the type of E1.E2?

@languagelawyer languagelawyer changed the title [expr.ref]/(4.3.2) function type spelling doesn't match [dcl.fct]/1 [expr.ref]/(6.3.2) function type spelling doesn't match [dcl.fct]/1 Jan 6, 2020
@jensmaurer jensmaurer self-assigned this Jan 10, 2020
@jensmaurer
Copy link
Member

jensmaurer commented Jan 10, 2020

I agree with most of the suggestions, but the "parameter-type-list" actually better captures the processing that occurs between the parameter-declaration-clause and the resulting types. (Thus, [dcl.fct] should be fixed.)

Oh, and "cv" is an established term for a set of cv-qualifiers, so I think we're good in that regard.

@languagelawyer
Copy link
Contributor Author

Is it actually necessary to repeat the full function type spelling, instead of just saying

if E1.E2 refers to a non-static member function and the type of E2 is FT

@jensmaurer
Copy link
Member

jensmaurer commented Jan 10, 2020

I'm actually wondering about something else: Do we have to include "cv" and "ref-qualifier" in the resulting type for E1.E2? After all, those things only matter when checking the relationship of E1 and E2, but once that has been cleared, they're irrelevant for further processing. The relevant overload resolution section talks about "the non-static member function", so don't actually refer to "E1.E2" which is a funny prvalue invented for recursive parsing mechanics but not much else.

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

Successfully merging a pull request may close this issue.

2 participants