[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

Zinovy Nis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 22:15:11 PST 2020


zinovy.nis marked an inline comment as done.
zinovy.nis added a comment.

In D91037#2387377 <https://reviews.llvm.org/D91037#2387377>, @njames93 wrote:

> Taking a step back, rather than worrying about if its an `ExprWithCleanups`. Shouldn't we just get the condition removing all implicit nodes.
>
>   const Expr* Cond = InnerIf->getCond()->ignoreImplicit();
>
> This has to be simpler and will likely future proof this against any other implicit nodes potentially added in future that can appear between the Condition and the binary operator.

Nice! Thanks. Changed to use `IgnoreImplicit()`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91037/new/

https://reviews.llvm.org/D91037



More information about the cfe-commits mailing list