zinovy.nis marked an inline comment as done and 2 inline comments as not done. zinovy.nis added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:85 // remove the inner `if`. - const auto *BinOpCond = dyn_cast<BinaryOperator>(InnerIf->getCond()); + const auto *BinOpCond = dyn_cast_or_null<BinaryOperator>(InnerIf->getCond()); + if (!BinOpCond) ---------------- aaron.ballman wrote: > Under what circumstances does `getCond()` return `nullptr`? `getCond()` is not null, but it can be `ExprWithCleanupsCond` leading the original `dyn_cast` to crash. That what this bug is about. ================ Comment at: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:90 + BinOpCond = dyn_cast_or_null<BinaryOperator>( + *ExprWithCleanupsCond->children().begin()); + ---------------- aaron.ballman wrote: > You can call `ExprWithCleanupsCond->getSubExpr()` to do this more cleanly -- > but similar question here as above -- what circumstances lead to a null sub > expression? Thanks, fixed to use `getSubExpr()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new/ https://reviews.llvm.org/D91037 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits