Skip to content

CWG2813: extra move in calling of explicit object member function #100314

@Fedr

Description

@Fedr

This program

struct A {
    A() {}
    A(A&&) = delete;
    void f(this A) {}
};

int main() {
    A{}.f();
}

must be accepted per CWG2813, and GCC does accept it, but not Clang unfortunately.

Online demo: https://gcc.godbolt.org/z/6x7PTsE4M

Related discussion: https://stackoverflow.com/q/78785176/7325599

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang: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