devjgm updated this revision to Diff 407288.
devjgm added a comment.

Accepted ymandel's suggestion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119370/new/

https://reviews.llvm.org/D119370

Files:
  clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp


Index: clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
+++ clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
@@ -194,8 +194,8 @@
           << (InvocationParm->getFunctionScopeIndex() + 1) << FunctionName
           << *InvocationParmType << ExpectParmTypeName;
     }
-  } else if (ReceivingExpr) {
-    if ((*InvocationParmType)->isRValueReferenceType() || !CheckMoveToConstRef)
+  } else if (ReceivingExpr && CheckMoveToConstRef) {
+    if ((*InvocationParmType)->isRValueReferenceType())
       return;
 
     auto Diag = diag(FileMoveRange.getBegin(),


Index: clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
+++ clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
@@ -194,8 +194,8 @@
           << (InvocationParm->getFunctionScopeIndex() + 1) << FunctionName
           << *InvocationParmType << ExpectParmTypeName;
     }
-  } else if (ReceivingExpr) {
-    if ((*InvocationParmType)->isRValueReferenceType() || !CheckMoveToConstRef)
+  } else if (ReceivingExpr && CheckMoveToConstRef) {
+    if ((*InvocationParmType)->isRValueReferenceType())
       return;
 
     auto Diag = diag(FileMoveRange.getBegin(),
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to