[clang] [clang] Replace X && isa<Y>(X) with isa_and_nonnull<Y>(X). NFC (PR #94987)

Pavel Samolysov via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 10:08:24 PDT 2024


================
@@ -2772,7 +2772,7 @@ fixVariable(const VarDecl *VD, FixitStrategy::Kind K,
         // also covers call-operator of lamdas
         isa<CXXMethodDecl>(FD) ||
         // skip when the function body is a try-block
-        (FD->hasBody() && isa<CXXTryStmt>(FD->getBody())) ||
+        isa_and_nonnull<CXXTryStmt>(FD->getBody()) ||
----------------
samolisov wrote:

I believe this is just my bad, I undistinguished `->hasBody()` and `->getBody()`. I'll fix it, thank you.

https://github.com/llvm/llvm-project/pull/94987


More information about the cfe-commits mailing list