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

[dcl.fct.default] Correct note on 'this' in default arguments #6836

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eisenwave
Copy link
Contributor

Fixes #6558.

This implements the wording suggested by @jensmaurer.

@jensmaurer
Copy link
Member

Can we use sizeof(this) in a default argument? If so, "subexpression" is not the right term. Maybe we're looking at "potentially-evaluated" or "odr-usable". (We should be correct in notes, but not necessarily exhaustive.)

@Eisenwave
Copy link
Contributor Author

Can we use sizeof(this) in a default argument? If so, "subexpression" is not the right term. Maybe we're looking at "potentially-evaluated" or "odr-usable". (We should be correct in notes, but not necessarily exhaustive.)

No, we cannot. [expr.prim.this] p3 defines this only between the optional cv-qualifier-seq and the end of the declaration/definition. Default arguments are in the parameter-declaration-clause of parameters-and-qualifiers, which precedes the cv-qualifier-seq.

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.default] Incorrect note on this in default arguments
2 participants