Author: Kazu Hirata Date: 2026-10-10T08:18:45Z New Revision: 47b49482c9dd02228054d984358d9d83d8fdd41c
URL: https://github.com/llvm/llvm-project/commit/47b49482c9dd02228054d984358d9d83d8fdd41c DIFF: https://github.com/llvm/llvm-project/commit/47b49482c9dd02228054d984358d9d83d8fdd41c.diff LOG: [clang] Replace PointerUnion::dyn_cast with llvm::dyn_cast (NFC) (#230747) PointerUnion::dyn_cast has been soft-deprecated in favor of llvm::dyn_cast and llvm::dyn_cast_if_present. This patch replaces the former with llvm::dyn_cast where the operand is guaranteed to be nonnull. {Class,Var}TemplateSpecializationDecl::getSpecializedTemplateOrPartial() always returns a nonnull pointer by construction regardless of whether the specialization is from a primary template or a partial specialization. Assisted-by: Antigravity Added: Modified: clang/lib/Sema/SemaTemplate.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 8e7433bc71281..4406e81d189b6 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -11955,10 +11955,10 @@ class ExplicitSpecializationVisibilityChecker { return; auto From = SD->getSpecializedTemplateOrPartial(); - if (auto *TD = From.dyn_cast<ClassTemplateDecl *>()) + if (auto *TD = dyn_cast<ClassTemplateDecl *>(From)) checkTemplate(TD); else if (auto *TD = - From.dyn_cast<ClassTemplatePartialSpecializationDecl *>()) { + dyn_cast<ClassTemplatePartialSpecializationDecl *>(From)) { if (!CheckDeclaration(TD)) diagnose(TD, true); checkTemplate(TD); @@ -11971,10 +11971,10 @@ class ExplicitSpecializationVisibilityChecker { return; auto From = SD->getSpecializedTemplateOrPartial(); - if (auto *TD = From.dyn_cast<VarTemplateDecl *>()) + if (auto *TD = dyn_cast<VarTemplateDecl *>(From)) checkTemplate(TD); else if (auto *TD = - From.dyn_cast<VarTemplatePartialSpecializationDecl *>()) { + dyn_cast<VarTemplatePartialSpecializationDecl *>(From)) { if (!CheckDeclaration(TD)) diagnose(TD, true); checkTemplate(TD); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
