jaafar marked 3 inline comments as done. jaafar added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:38 enum BindArgumentKind { BK_Temporary, BK_Placeholder, BK_CallExpr, BK_Other }; -enum CaptureMode { CM_None, CM_ByRef, CM_ByValue, CM_InitExpression }; +enum CaptureMode { CM_None, CM_ByRef, CM_ByValue }; +enum CaptureExpr { CE_None, CE_Var, CE_InitExpression }; ---------------- "Captured by reference" and "uses init expression" are not mutually exclusive - that gave rise to item 6 above. ================ Comment at: clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:150 +static bool tryCaptureAsLocalVariable(const MatchFinder::MatchResult &Result, + BindArgument &B, const Expr *E); ---------------- These forward declarations seemed to make the diffs a lot easier to read. It's also possible to move the two functions into this position, of course. ================ Comment at: clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:243 + if ((std::distance(ME->child_begin(), ME->child_end()) == 1) && + isa<CXXThisExpr>(*ME->children().begin())) { + // reference to data member without explicit "this" ---------------- Is there a better way to express this? "a single child of type ThisExpr" was what I was going for... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81769/new/ https://reviews.llvm.org/D81769 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits