Issue 204111
Summary [clang-tidy] performance-move-const-arg CheckTriviallyCopyableMove warns where there is no performance impact
Labels
Assignees
Reporter TedLyngmo
    `std::move` on a trivially copyable type to construct or assign the rvalue to another instance results in a plain copy, just as-if the `std::move` wasn't there at all. How is this warning meant to help improve performance?

I'd rather see code where `std::move` is consistently used to show _intent_. Those "moves" also helps when redefining types. If we remove these moves, we'll have to add them back later in case the types later becomes cheaper to move than to copy.

* I suggest moving the `CheckTriviallyCopyableMove` option away from `performance-move-const-arg`.
    Motivation: It doesn't have anything to do with moving a `const` arg.

* I suggest moving `CheckTriviallyCopyableMove` completely out of `performance-*`.
    Motivation: Removing these `std::move`s don't improve perfomance.

* I suggest disabling `CheckTriviallyCopyableMove` by default.
    Motivation: It's highly arguable that it promotes writing code where the intent is clear. I argue that it does the opposite.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to