Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-tidy] [false-positive] performance-move-const-arg #86404

Closed
schaumb opened this issue Mar 23, 2024 · 0 comments · Fixed by #95633
Closed

[clang-tidy] [false-positive] performance-move-const-arg #86404

schaumb opened this issue Mar 23, 2024 · 0 comments · Fixed by #95633
Assignees
Labels
clang-tidy false-positive Warning fires when it should not

Comments

@schaumb
Copy link

schaumb commented Mar 23, 2024

The current check falsely tries to remove the std::move when the return value is a rvalue reference type.

An example:

struct A {};
struct B {
  operator A&&() const {
    static A a;
    return std::move(a); // Clang-Tidy: Std::move of the variable 'a' of the trivially-copyable type 'A' has no effect; remove std::move() 
  }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang-tidy false-positive Warning fires when it should not
Projects
None yet
3 participants