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

Felix Berger via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 1 12:40:56 PDT 2016

flx added inline comments.

Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:34
@@ -29,1 +33,3 @@
+template <typename S> bool isSetDifferenceEmpty(const S &S1, const S &S2) {
+  for (const auto &E : S1)
alexfh wrote:
> +1 to `isSubset`. And please add a comment explaining what should be a subset of what for this function to return `true`.
Omitted the comment by making the parameter names very explicit.

Comment at: clang-tidy/utils/Matchers.h:50
@@ +49,3 @@
+AST_MATCHER_FUNCTION(ast_matchers::TypeMatcher, isReferenceToConst) {
+  return ast_matchers::referenceType(ast_matchers::pointee(
+      ast_matchers::qualType(ast_matchers::isConstQualified())));
alexfh wrote:
> How about `using ast_matchers;` in this function to make the statement easier to read?
Used `using namespace ast_matchers;`.


More information about the cfe-commits mailing list