Skip to content

Commit 0f3c288

Browse files
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124433)
Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T> 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 U to be nonnull.
1 parent 19a6ac1 commit 0f3c288

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/ParentMapContext.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class ParentMapContext::ParentMap {
103103

104104
static DynTypedNode
105105
getSingleDynTypedNodeFromParentMap(ParentMapPointers::mapped_type U) {
106-
if (const auto *D = U.dyn_cast<const Decl *>())
106+
if (const auto *D = dyn_cast<const Decl *>(U))
107107
return DynTypedNode::create(*D);
108-
if (const auto *S = U.dyn_cast<const Stmt *>())
108+
if (const auto *S = dyn_cast<const Stmt *>(U))
109109
return DynTypedNode::create(*S);
110110
return *cast<DynTypedNode *>(U);
111111
}

0 commit comments

Comments
 (0)