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.prim.this]/2 alludes to the grammar production declarator without necessity #2306

Closed
jabelloc opened this issue Aug 23, 2018 · 3 comments
Assignees

Comments

@jabelloc
Copy link

jabelloc commented Aug 23, 2018

[expr.prim.this]/2:

If a declaration declares a member function or member function template of a class X, the expression this is a prvalue of type “pointer to cv-qualifier-seq X” between the optional cv-qualifier-seq and the end of the function-definition, member-declarator, or declarator. . . .

A member-declarator is already defined in terms of a declarator. Therefore, the declarator can be eliminated above without loss of generality.

@cpplearner
Copy link
Contributor

cpplearner commented Sep 3, 2018

In template auto A::f(int t) -> decltype(t + g());, A::f(int t) -> decltype(t + g()) is a declarator but not a member-declarator.

@jensmaurer
Copy link
Member

Right you are.

@cpplearner
Copy link
Contributor

(But declarator should probably be changed to init-declarator, to make this valid in a trailing requires-clause.)

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