[PATCH] D50102: [clang-tidy] Use ExprMutationAnalyzer in performance-unnecessary-value-param

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 1 04:11:18 PDT 2018


hokein added a comment.

Mostly good. A few nits.



================
Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:103
 
   // Do not trigger on non-const value parameters when they are not only used as
   // const.
----------------
This comment needs to be updated.


================
Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:108
     return;
+  if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(Function)) {
+    for (const auto *Init : Ctor->inits()) {
----------------
Is this a new fix or  a special case not being caught by `ExprMutationAnalyzer`?  Do we have a test case covered it?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50102





More information about the cfe-commits mailing list