https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/123012
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 P to be nonnull. >From c81b4e5182c88d939246335ec5796467fc4a1436 Mon Sep 17 00:00:00 2001 From: Kazu Hirata <k...@google.com> Date: Tue, 14 Jan 2025 15:38:03 -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<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 P to be nonnull. --- clang/lib/AST/ASTImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index dec4c7221bc776..0669aa1b809c34 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -6376,7 +6376,7 @@ ExpectedDecl ASTNodeImporter::VisitClassTemplateSpecializationDecl( D2->setTemplateSpecializationKind(D->getTemplateSpecializationKind()); if (auto P = D->getInstantiatedFrom()) { - if (auto *CTD = P.dyn_cast<ClassTemplateDecl *>()) { + if (auto *CTD = dyn_cast<ClassTemplateDecl *>(P)) { if (auto CTDorErr = import(CTD)) D2->setInstantiationOf(*CTDorErr); } else { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits