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

P2386R0 Core Language Working Group "ready" Issues for the June, 2021 meeting #4693

Merged
merged 10 commits into from Jun 15, 2021

Conversation

jensmaurer
Copy link
Member

@jensmaurer jensmaurer commented Jun 11, 2021

Fixes #4631
Fixes #4612
Fixes #2789
Fixes #4305
Fixes #2334
Partially addresses #3262
Fixes cplusplus/papers#1059

@jensmaurer jensmaurer marked this pull request as ready for review June 11, 2021 20:37
@jensmaurer jensmaurer added this to the post-2021-06 milestone Jun 11, 2021
The normative context to which the note refers was substantially
altered by CWG2466.
@languagelawyer
Copy link
Contributor

Shouldn't CWG2458 resolution also modify [basic.lval] wording, as in #3262?

@jensmaurer
Copy link
Member Author

Shouldn't CWG2458 resolution also modify [basic.lval] wording, as in #3262?

Maybe it should, but it's not part of the motion, so we should revisit after we're done with the motions.
I think C::f, when it is an lvalue, still "identifies a function" per [basic.lval].

@languagelawyer
Copy link
Contributor

I think C::f, when it is an lvalue, still "identifies a function"

This is fine. The thing is that C::f identifies a function when it is a prvalue, whilst [basic.lval] says that evaluated expressions denoting functions are glvalues. And I think class member access expression e.C::f is where C::f is evaluated and is a prvalue.

@jensmaurer
Copy link
Member Author

And I think class member access expression e.C::f is where C::f is evaluated and is a prvalue.

Ok, but then the proposed change in #3262 isn't actually what we want post-CWG2458.
Instead, we want to augment the definition of "prvalue" such that C::f fits.

@languagelawyer
Copy link
Contributor

Instead, we want to augment the definition of "prvalue" such that C::f fits.

The current definition — A prvalue is an expression whose evaluation ... computes the value of an operand of an operator — looks fine to me, since C::f computes the value of the right operand of the . or -> operator. The definition of «glvalue» should say that some expressions denoting a non-static member functions are not glvalues.

@jensmaurer
Copy link
Member Author

jensmaurer commented Jun 14, 2021

The "glvalue" and "prvalue" definitions do not exhaustively describe which expressions yield which kinds. I agree that C::f could be the operand of an operator. But C::f also designates a function (in case we take its address). So, this seems fine both ways.

@tkoeppe tkoeppe self-requested a review June 15, 2021 01:03
@tkoeppe tkoeppe merged commit bcfef14 into master Jun 15, 2021
@languagelawyer
Copy link
Contributor

The "glvalue" and "prvalue" definitions do not exhaustively describe which expressions yield which kinds.

I'm fine with it, but let me remind that there was CWG1076 issue about value category inconsistency:

The taxonomy of value categories in 7.2.1 [basic.lval] classifies temporaries as prvalues. However, some temporaries are explicitly referred to as lvalues (cf 14.2 [except.throw] paragraph 3).

which can be reformulated for CWG2458 resolution:

The taxonomy of value categories in [basic.lval] classifies function designators as glvalues. However, some non-static member function designators are explicitly referred to as prvalues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants