aaron.ballman added a comment. LGTM, though I have a possible code simplification if you think it's an improvement.
================ Comment at: clang-tools-extra/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp:78 + + if (const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>("expr")) { + const Decl *D = DeclRef->getDecl(); ---------------- Can you get away with: ``` if (const auto *E = Result.Nodes.getNodeAs<Expr>("expr")) { const Decl *D = isa<DeclRefExpr> ? cast<DeclRefExpr>(E)->getDecl() : cast<MemberExpr>(E)->getMemberDecl(); const auto M = ignoringParenImpCasts(anyOf(declRefExpr(to(equalsNode(D))), memberExpr(hasDeclaration(equalsNode(D))))); checkImpl(Result, E, If, M, *this); } ``` (Totally untested, but it hopefully demonstrates the point.) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83188/new/ https://reviews.llvm.org/D83188 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits