Skip to content

Commit 69c9bed

Browse files
[Serialization] Migrate away from PointerUnion::dyn_cast (NFC) (#124676)
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 FD->TemplateOrSpecialization to be nonnull.
1 parent 2ef497e commit 69c9bed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Serialization/ASTReaderDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4682,8 +4682,8 @@ void ASTDeclReader::UpdateDecl(Decl *D) {
46824682
MSInfo->setPointOfInstantiation(POI);
46834683
} else {
46844684
auto *FD = cast<FunctionDecl>(D);
4685-
if (auto *FTSInfo = FD->TemplateOrSpecialization
4686-
.dyn_cast<FunctionTemplateSpecializationInfo *>())
4685+
if (auto *FTSInfo = dyn_cast<FunctionTemplateSpecializationInfo *>(
4686+
FD->TemplateOrSpecialization))
46874687
FTSInfo->setPointOfInstantiation(POI);
46884688
else
46894689
cast<MemberSpecializationInfo *>(FD->TemplateOrSpecialization)

0 commit comments

Comments
 (0)