Skip to content

clang trunk does not compile overloaded member functions with ref-qualifier #76358

Closed
@forworldm

Description

@forworldm
struct C {
    template<int> void f() && {}
    template<typename T> void f() const {}
};
<source>:3:31: error: cannot overload a member function without a ref-qualifier with a member function with ref-qualifier '&&'
    3 |     template<typename T> void f() const {}
      |                               ^
<source>:2:24: note: previous declaration is here
    2 |     template<int> void f() && {}
      |                        ^
1 error generated.
Compiler returned: 1

see https://godbolt.org/z/Kv83s6oY3

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions