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

[class.this] Member functions are not cv-qualified. #3581

Merged
merged 2 commits into from Jan 13, 2020

Conversation

jensmaurer
Copy link
Member

Fixes #3579.

@jensmaurer
Copy link
Member Author

We should probably move the restriction on cv-qualifiers of the member function vs. the object expression to [expr.ref], where the expression is actually formed. @zygoloid , any opinion here?

source/classes.tex Outdated Show resolved Hide resolved
@jensmaurer jensmaurer added the changes requested Changes to the wording or approach have been requested and not yet applied. label Dec 28, 2019
@jensmaurer jensmaurer removed the changes requested Changes to the wording or approach have been requested and not yet applied. label Dec 28, 2019
@zygoloid zygoloid merged commit 0a7b360 into cplusplus:master Jan 13, 2020
@zygoloid
Copy link
Member

The restriction on cv-qualifiers of the member function vs the object expression are already enforced in two other places: in overload resolution and in [expr.call]/7 (which says "the this parameter of the function is initialized with a pointer to the object of the call, converted as if by an explicit type conversion").

I wouldn't want to move this wording to [expr.ref] unless we can remove it from [expr.call], which I don't think we can, since we do still need to define the initialization of the implicit object parameter in [expr.call].

Curiously, the pointer-to-member case currently says it has the same restrictions on cv-qualification that are described in [expr.ref], which doesn't describe any such restrictions...

@jensmaurer jensmaurer deleted the c16 branch January 14, 2020 06:14
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 this pull request may close these issues.

[dcl.fct]/7 [class.this]/3 cv-qualified function types
3 participants