Skip to content

Commit 148da06

Browse files
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124229)
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 UPP.first to be nonnull.
1 parent b4ef11d commit 148da06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/include/clang/Sema/SemaInternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ inline std::pair<unsigned, unsigned> getDepthAndIndex(const NamedDecl *ND) {
7272
/// Retrieve the depth and index of an unexpanded parameter pack.
7373
inline std::pair<unsigned, unsigned>
7474
getDepthAndIndex(UnexpandedParameterPack UPP) {
75-
if (const auto *TTP = UPP.first.dyn_cast<const TemplateTypeParmType *>())
75+
if (const auto *TTP = dyn_cast<const TemplateTypeParmType *>(UPP.first))
7676
return std::make_pair(TTP->getDepth(), TTP->getIndex());
7777

7878
return getDepthAndIndex(cast<NamedDecl *>(UPP.first));

0 commit comments

Comments
 (0)