================ @@ -261,21 +262,27 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { this); } +UnnecessaryCopyInitialization::CheckContext::CheckContext( ---------------- legrosbuffle wrote:
I think it's a simple matter of preference, I think we can see the constructor as a factory function for the context. To me the following are all kind of equivalent: - `CheckContext Context(Result);` - `CheckContext Context = MakeContext(Result);` - `CheckContext Context{NewVar, ...}` With the caveat that the latter allows putting the context in an invalid state (e.g. with `IsVarUnused` in an inconsistent value w.r.t. `Var`). Anyway I don't feel strongly, so I've switched to a raw struct without ctor as suggested. https://github.com/llvm/llvm-project/pull/73921 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits