Skip to content

Commit 04d5608

Browse files
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124430)
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.
1 parent 563c7c5 commit 04d5608

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/AST/DeclTemplate.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,8 +1801,7 @@ TemplateParameterList *clang::getReplacedTemplateParameterList(Decl *D) {
18011801
case Decl::Kind::VarTemplateSpecialization: {
18021802
const auto *VTSD = cast<VarTemplateSpecializationDecl>(D);
18031803
auto P = VTSD->getSpecializedTemplateOrPartial();
1804-
if (const auto *VTPSD =
1805-
P.dyn_cast<VarTemplatePartialSpecializationDecl *>())
1804+
if (const auto *VTPSD = dyn_cast<VarTemplatePartialSpecializationDecl *>(P))
18061805
return VTPSD->getTemplateParameters();
18071806
return cast<VarTemplateDecl *>(P)->getTemplateParameters();
18081807
}

0 commit comments

Comments
 (0)