sbenza added inline comments. ================ Comment at: clang-tidy/misc/MoveConstantArgumentCheck.cpp:20 @@ +19,3 @@ + const auto* CallMove = result.Nodes.getNodeAs<CallExpr>("call-move"); + if (CallMove->getNumArgs() != 1) return; + const Expr* Arg = CallMove->getArg(0); ---------------- You can move both checks to the matcher. Something like:
callExpr(callee(functionDecl(hasName("::std::move"))), argumentCountIs(1), hasArgument(0, expr(hasType(isConstQualified())))) ================ Comment at: clang-tidy/misc/MoveConstantArgumentCheck.cpp:32 @@ +31,3 @@ + diag(CallMove->getLocStart(), "move of const variable") + << FixItHint::CreateReplacement(MoveRange, ArgString); + } ---------------- It is better to remove/insert than to replace. Replacement could strip comments inadvertently. In this case it also removes the need to find the text for the replacement. You could do: Remove(CallMove->Start(), Arg->Start()) Remove(CallMove->End(), CallMove->End()) http://reviews.llvm.org/D12031 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits