From 956afa4077d79e0bc9fa4d39b1d583985d661861 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 30 Jan 2025 18:09:20 -0800 Subject: [PATCH] [AST] Migrate away from PointerUnion::dyn_cast (NFC) Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa, cast and the llvm::dyn_cast Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect NodeOrVector to be nonnull. --- clang/lib/AST/ParentMapContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/ParentMapContext.cpp b/clang/lib/AST/ParentMapContext.cpp index 2e77e1d7c4c64..e9387ec79c373 100644 --- a/clang/lib/AST/ParentMapContext.cpp +++ b/clang/lib/AST/ParentMapContext.cpp @@ -395,7 +395,7 @@ class ParentMapContext::ParentMap::ASTVisitor if (!isa(NodeOrVector)) { auto *Vector = new ParentVector( 1, getSingleDynTypedNodeFromParentMap(NodeOrVector)); - delete NodeOrVector.template dyn_cast(); + delete dyn_cast(NodeOrVector); NodeOrVector = Vector; }