[clang-tools-extra] r270473 - Commiting for http://reviews.llvm.org/D20365

Mads Ravn via cfe-commits cfe-commits at lists.llvm.org
Mon May 23 11:27:07 PDT 2016


Author: madsravn
Date: Mon May 23 13:27:05 2016
New Revision: 270473

URL: http://llvm.org/viewvc/llvm-project?rev=270473&view=rev
Log:
Commiting for http://reviews.llvm.org/D20365

Modified:
    clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=270473&r1=270472&r2=270473&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Mon May 23 13:27:05 2016
@@ -181,12 +181,6 @@ void PassByValueCheck::check(const Match
   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.

Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp?rev=270473&r1=270472&r2=270473&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp Mon May 23 13:27:05 2016
@@ -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) {}
-};




More information about the cfe-commits mailing list