[PATCH] D106011: [clang-tidy] performance-unnecessary-copy-initialization: Disable check when variable and initializer have different replaced template param types.

Felix Berger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 22 10:10:40 PDT 2021


flx added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:178-183
+      if (VarTmplType->getReplacedParameter()->desugar().getCanonicalType() !=
+          InitializerTmplType->getReplacedParameter()
+              ->desugar()
+              .getCanonicalType()) {
+        return true;
+      }
----------------
ymandel wrote:
> nit: maybe just return the condition (instead of using if(...) return true)? that is
> return VarTmpType->... != ...
Done. Was left over from when there were debug statements there ;)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106011



More information about the cfe-commits mailing list