Skip to content

CWG2692 Static and explicit object member functions with the same parameter-type-lists #1455

Description

@jensmaurer

Consider this example:

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

    void g();
  };

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

What should happen for #1? One possible answer is that the /member-specification/ of A is ill-formed because of conflicting declarations for f. That would also allow mangling the explicit-object member function A::f the same as the static member function.

See CWG2692

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++23Targeted at C++23CWGCoreplenary-approvedPapers approved for inclusion in their target vehicle by plenary vote.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Approved for plenary vote

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions