Skip to content

Commit e673f9d

Browse files
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#122855)
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 DeclOrVector to be nonnull.
1 parent 2b961b0 commit e673f9d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Sema/SemaCodeComplete.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ class ResultBuilder {
121121
return;
122122
}
123123

124-
if (const NamedDecl *PrevND =
125-
DeclOrVector.dyn_cast<const NamedDecl *>()) {
124+
if (const NamedDecl *PrevND = dyn_cast<const NamedDecl *>(DeclOrVector)) {
126125
// 1 -> 2 elements: create the vector of results and push in the
127126
// existing declaration.
128127
DeclIndexPairVector *Vec = new DeclIndexPairVector;
@@ -702,7 +701,7 @@ ResultBuilder::ShadowMapEntry::begin() const {
702701
if (DeclOrVector.isNull())
703702
return iterator();
704703

705-
if (const NamedDecl *ND = DeclOrVector.dyn_cast<const NamedDecl *>())
704+
if (const NamedDecl *ND = dyn_cast<const NamedDecl *>(DeclOrVector))
706705
return iterator(ND, SingleDeclIndex);
707706

708707
return iterator(cast<DeclIndexPairVector *>(DeclOrVector)->begin());

0 commit comments

Comments
 (0)