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


2692. Static and explicit object member functions with the same parameter-type-lists

Section:  []     Status: C++23     Submitter: Matthew House     Date: 2023-01-16     Liaison: EWG

[Accepted at the February, 2023 meeting as part of paper P2797R0.]

(Split off from issue 2687.)


  struct A {
    static void f(A);
    void f(this A);

    void g();

  void A::g() {
    (&A::f)(A()); // #1
    (&A::f)();    // #2

It is obvious that #2 is ill-formed, but what about #1? One possible answer is to make such declarations conflict.

Suggested resolution:

  1. Change in 6.4.1 [basic.scope.scope] paragraph 3, adding bullets, a follows:

    Two function templates have corresponding signatures if
    • their template-parameter-lists have the same length,
    • their corresponding template-parameters are equivalent,
    • they have equivalent
      • parameter-type-lists or non-object-parameter-type-lists and
      • return types (if any), and,
    • if both are non-static members, they have corresponding object parameters.
  2. Change in 6.4.1 [basic.scope.scope] bullet 4.3.1 as follows:

    • both declare functions with the same parameter-type-list or non-object-parameter-type-list [Footnote: ...], equivalent ( []) trailing requires-clauses (if any, except as specified in 13.7.5 [temp.friend]), and, if both are non-static members, they have corresponding object parameters, or

CWG 2023-01-27

Forward to EWG to determine whether such member declarations are considered sufficiently confusing to outweigh concerns of language orthogonality; see plusplus/papers#1455.