[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 10:25:31 PST 2023


================
@@ -261,21 +262,27 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) {
                      this);
 }
 
+UnnecessaryCopyInitialization::CheckContext::CheckContext(
----------------
PiotrZSL wrote:

I'm not a fan of this constructor, it should exist.
instead object of CheckContext should be created as:

```
CheckContext context{*NewVar, *BlockStmt, *OldVar, ...};
```

simply moving functionality of check into helper class isn't nice.
```

https://github.com/llvm/llvm-project/pull/73921


More information about the cfe-commits mailing list