[clang] [StaticAnalyzer] Migrate away from PointerUnion::{is,get} (NFC) (PR #118421)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 10:39:58 PST 2024


================
@@ -196,13 +196,13 @@ const PointerToMemberData *BasicValueFactory::accumCXXBase(
   const NamedDecl *ND = nullptr;
   llvm::ImmutableList<const CXXBaseSpecifier *> BaseSpecList;
 
-  if (PTMDT.isNull() || PTMDT.is<const NamedDecl *>()) {
-    if (PTMDT.is<const NamedDecl *>())
-      ND = PTMDT.get<const NamedDecl *>();
+  if (PTMDT.isNull() || isa<const NamedDecl *>(PTMDT)) {
+    if (isa<const NamedDecl *>(PTMDT))
----------------
kazutakahirata wrote:

Switched to `dyn_cast_if_present` because `PTMDT` could be null.

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


More information about the cfe-commits mailing list