diff options
-rw-r--r-- | clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp | 6 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp | 7 |
2 files changed, 0 insertions, 13 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp index 31a1d96320e..c727deb7969 100644 --- a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp @@ -181,12 +181,6 @@ void PassByValueCheck::check(const MatchFinder::MatchResult &Result) { if (!paramReferredExactlyOnce(Ctor, ParamDecl)) return; - - // If the parameter is trivial to copy, don't move it. Moving a trivivally - // copyable type will cause a problem with modernize-pass-by-value - if (ParamDecl->getType().isTriviallyCopyableType(*Result.Context)) - return; - auto Diag = diag(ParamDecl->getLocStart(), "pass by value and use std::move"); // Iterate over all declarations of the constructor. diff --git a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp index e4c97317b3f..724b1f69cfe 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp @@ -193,10 +193,3 @@ struct S { // CHECK-FIXES: S(Movable &&M) : M(M) {} Movable M; }; - -// Test that types that are trivially copyable will not use std::move. This will -// cause problems with misc-move-const-arg, as it will revert it. -struct T { - std::array<int, 10> a_; - T(std::array<int, 10> a) : a_(a) {} -}; |