Skip to content

Conversation

eisenwave
Copy link
Member

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
Member 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