Skip to content

Clang rejects valid program by not removing top-level cv-qualifier when overloading explicit object member function  #100394

@ranaanoop

Description

@ranaanoop

The following valid program is rejected by clang but accepted by other three compilers. Demo

struct C {
    void j(this const C);
    void j() const ;             //#1: Clang:Nope while gcc and msvc:Ok 
};

As explained in this thread this is well-formed. Clang doesn't seem to remove the top-level const qualifier from the first overload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions