================ @@ -263,19 +264,26 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { void UnnecessaryCopyInitialization::check( const MatchFinder::MatchResult &Result) { - const auto *NewVar = Result.Nodes.getNodeAs<VarDecl>("newVarDecl"); + const auto &NewVar = *Result.Nodes.getNodeAs<VarDecl>("newVarDecl"); + const auto &BlockStmt = *Result.Nodes.getNodeAs<Stmt>("blockStmt"); + const auto &VarDeclStmt = *Result.Nodes.getNodeAs<DeclStmt>("declStmt"); + const CheckContext Context{ + NewVar, BlockStmt, VarDeclStmt, *Result.Context, + // Do not propose fixes if the DeclStmt has multiple VarDecls or in + // macros since we cannot place them correctly. + /*IssueFix*/ VarDeclStmt.isSingleDecl() && ---------------- legrosbuffle wrote:
Done. 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