Skip to content

Commit 90dd964

Browse files
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#125457)
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 typeDecl to be nonnull. Note that getObjCInterfaceType starts out dereferencing Decl.
1 parent cd4e360 commit 90dd964

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaDeclObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ void SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(
15841584
const char* prevSpec; // unused
15851585
unsigned diagID; // unused
15861586
QualType type;
1587-
if (auto *actualTypeDecl = typeDecl.dyn_cast<TypeDecl *>())
1587+
if (auto *actualTypeDecl = dyn_cast<TypeDecl *>(typeDecl))
15881588
type = Context.getTypeDeclType(actualTypeDecl);
15891589
else
15901590
type = Context.getObjCInterfaceType(cast<ObjCInterfaceDecl *>(typeDecl));

0 commit comments

Comments
 (0)