[PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Tue May 31 00:46:02 PDT 2016


Prazek added a comment.

In http://reviews.llvm.org/D20277#436725, @flx wrote:

> In http://reviews.llvm.org/D20277#436717, @Prazek wrote:
>
> > Cool check! Did you think about sugesting std::move for rvalue references if they are used once?
>
>
> Thanks! I'm not sure this fits with what a user would expect from a check named "unnecessary-value-param" since in this case the parameter is not passed by value. Would a separate check make sense for this?


Consider changing the name :) When I was thinking about the check for rvalue references, I wanted to name it "*-rvalue-ref-one-use". 
If it covers values also, maybe "performance-move-single-used-variable" or "performance-variable-one-use", or "performance-disposable-object" (If I translated it correctly).

In my opinion there is no need to have separate check to to this, because the user would like to have both or none.


http://reviews.llvm.org/D20277





More information about the cfe-commits mailing list