This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


2458. Value category of expressions denoting non-static member functions

Section:  [expr.ref]     Status: CD6     Submitter: Andrey Erokhin     Date: 2020-07-04

[Accepted as a DR at the June, 2021 meeting.]

Expressions denoting non-static member functions are currently classified as prvalues ( [] paragraph 2; [expr.ref] bullet 6.3.2; and 7.6.4 [expr.mptr.oper] paragraph 6). It would simplify the specification if such expressions were categorized as lvalues. (See also this pull request.)

Notes from the August, 2020 teleconference:

CWG preferred that the unbound case (i.e., &X::f) should be an lvalue, while the bound case should be a prvalue.

Proposed resolution (April, 2021):

  1. Change [] paragraph 5, converting the running text into a bulleted list, as follows:

  2. The result of a qualified-id Q is the entity it denotes (6.5.5 [basic.lookup.qual]). The type of the expression is the type of the result. The result is an lvalue if the member is

    and a prvalue otherwise.

  3. Change [expr.unary.op] paragraph 3 as follows:

  4. The result of the The operand of the unary & operator shall be an lvalue of some type T. The result is a pointer to its operand prvalue.

[Drafting note: neither [expr.ref] bullet 6.3.2,

nor 7.6.4 [expr.mptr.oper] paragraph 6,

...The result of a .* expression whose second operand is a pointer to a member function is a prvalue...

requires any change.]