Skip to content

Commit b68a952

Browse files
[clang-doc] Migrate away from PointerUnion::{is,get} (NFC) (#120872)
Note that PointerUnion::{is,get} have 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>
1 parent 9423961 commit b68a952

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

clang-tools-extra/clang-doc/Serialize.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -696,13 +696,11 @@ emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
696696

697697
// What this is a specialization of.
698698
auto SpecOf = CTSD->getSpecializedTemplateOrPartial();
699-
if (SpecOf.is<ClassTemplateDecl *>()) {
700-
Specialization.SpecializationOf =
701-
getUSRForDecl(SpecOf.get<ClassTemplateDecl *>());
702-
} else if (SpecOf.is<ClassTemplatePartialSpecializationDecl *>()) {
703-
Specialization.SpecializationOf =
704-
getUSRForDecl(SpecOf.get<ClassTemplatePartialSpecializationDecl *>());
705-
}
699+
if (auto *CTD = dyn_cast<ClassTemplateDecl *>(SpecOf))
700+
Specialization.SpecializationOf = getUSRForDecl(CTD);
701+
else if (auto *CTPSD =
702+
dyn_cast<ClassTemplatePartialSpecializationDecl *>(SpecOf))
703+
Specialization.SpecializationOf = getUSRForDecl(CTPSD);
706704

707705
// Parameters to the specilization. For partial specializations, get the
708706
// parameters "as written" from the ClassTemplatePartialSpecializationDecl

0 commit comments

Comments
 (0)