Created on 2023-01-16.00:00:00 last changed 2 months ago
Additional notes (March, 2023)
The concern about incorrectly applying the this transformation was addressed by P2797R0 (Proposed resolution for CWG2692 Static and explicit object member functions with the same parameter-type-lists).
Proposed resolution (approved by CWG 2023-01-27):
Change in 18.104.22.168.1 [over.match.call.general] paragraph 2 as follows:
If the postfix-expression is the address of an overload set, overload resolution is applied using that set as described above. If the function selected by overload resolution is
a non-staticmember function, the program is ill-formed.
Subclause 12.3 [over.over] paragraph 4 says that explicit-object member functions match both kinds of pointer type, and 11.4.3 [class.mfct.non.static] paragraph 2 seems to try to transform (&A::f)(A()) into (&(*this).A::f)(A()) if f is an explicit-object member function.
[ Resolved by paper P2797R0, adopted in February 2023. ]
Subclause 22.214.171.124.1 [over.match.call.general] paragraph 2 specifies:
If the postfix-expression is the address of an overload set, overload resolution is applied using that set as described above. If the function selected by overload resolution is a non-static member function, the program is ill-formed.
However, 126.96.36.199 [expr.unary.op] paragraph 3 states that the address of an explicit object member function is a plain pointer to function, not a pointer to member. The former can be invoked using the regular function call syntax (188.8.131.52 [expr.call]) without the need for a pointer-to-member expression (7.6.4 [expr.mptr.oper]). For example, absent any overloading and given some function f, the expression (&A::f)(A()) could be valid if f is a static member function or an explicit object member function. However, that expression cannot possibly be valid if f is an implicit object member function.
|2023-07-16 13:00:43||admin||set||status: open -> c++23|
|2023-07-16 13:00:43||admin||set||status: wp -> open|
|2023-04-01 14:35:13||admin||set||status: review -> wp|
|2023-03-12 18:45:53||admin||set||messages: + msg7230|
|2023-02-07 18:56:51||admin||set||status: ready -> review|
|2023-02-07 14:43:26||admin||set||status: ready -> ready|
|2023-02-07 05:29:18||admin||set||status: tentatively ready -> ready|
|2023-02-06 00:00:00||admin||set||status: review -> tentatively ready|
|2023-01-27 23:50:39||admin||set||status: open -> review|
|2023-01-16 21:15:52||admin||set||messages: + msg7143|