Skip to content
Commit 7f882757 authored by Felix Berger's avatar Felix Berger
Browse files

[clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const...

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

Summary:

Make check more useful in the following two cases:

The parameter is passed by non-const value, has a non-deleted move constructor and is only referenced once in the function as argument to the type's copy constructor.
The parameter is passed by non-const value, has a non-deleted move assignment operator and is only referenced once in the function as argument of the the type's copy assignment operator.
In this case suggest a fix to move the parameter which avoids the unnecessary copy and is closest to what the user might have intended.

Reviewers: alexfh, sbenza

Subscribers: cfe-commits, Prazek

Differential Revision: http://reviews.llvm.org/D20277

llvm-svn: 274380
parent 2aac720a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment