Skip to content

Commit 7ab8f28

Browse files
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124883)
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> This patch migrates the use of PointerUnion::dyn_cast to dyn_cast_if_present because ShadowMapEntry::Add starts with: if (DeclOrVector.isNull()) { implying that DeclOrVector is not guaranteed to be nonnull.
1 parent c583df4 commit 7ab8f28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaCodeComplete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ResultBuilder {
137137

138138
~ShadowMapEntry() {
139139
if (DeclIndexPairVector *Vec =
140-
DeclOrVector.dyn_cast<DeclIndexPairVector *>()) {
140+
dyn_cast_if_present<DeclIndexPairVector *>(DeclOrVector)) {
141141
delete Vec;
142142
DeclOrVector = ((NamedDecl *)nullptr);
143143
}

0 commit comments

Comments
 (0)