-
Notifications
You must be signed in to change notification settings - Fork 763
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
[basic.lval] Non-static member function designator is a prvalue CWG2458 #3262
base: main
Are you sure you want to change the base?
Conversation
Hm, non-static member functions really don't fit into the value category taxonomy well at all. We do seem to be consistent, at least; [expr.prim.id.qual]/2 also says that I don't like complicating the definition of lvalue with this quirk (and note that we'd need to complicate the definition of prvalue with it too), so since it makes no observable difference, I'd like to first send this to CWG to see if we can reclassify non-static member function expressions as lvalues. That should simplify the wording: we get a simpler rule here, we get a simpler rule in [expr.prim.id.qual]/2, we get a simpler rule in [expr.ref] (all of /6.3 produces an lvalue). And we get a simpler rule for the We may still want a change here if we go that route:
|
Why? [expr.ref]/6.3.2 says:
And the definition of prvalue says:
I've thought this "computes the value of an operand of an operator" is enough to cover non-static member function designators usage. ("value" does not apply well, though). UPD: Ah, you mean that |
Should I send this? |
@languagelawyer: Now that CWG2458 has landed, could you please update the pull request accordingly? |
@jensmaurer rate the ugliness |
[expr.ref]/6.3.2: