Skip to content

Commit 8ed9968

Browse files
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#122651)
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 Ptr to be nonnull.
1 parent abba01a commit 8ed9968

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/include/clang/AST/DeclBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ class DeclListNode {
13341334

13351335
reference operator*() const {
13361336
assert(Ptr && "dereferencing end() iterator");
1337-
if (DeclListNode *CurNode = Ptr.dyn_cast<DeclListNode*>())
1337+
if (DeclListNode *CurNode = dyn_cast<DeclListNode *>(Ptr))
13381338
return CurNode->D;
13391339
return cast<NamedDecl *>(Ptr);
13401340
}
@@ -1344,7 +1344,7 @@ class DeclListNode {
13441344
inline iterator &operator++() { // ++It
13451345
assert(!Ptr.isNull() && "Advancing empty iterator");
13461346

1347-
if (DeclListNode *CurNode = Ptr.dyn_cast<DeclListNode*>())
1347+
if (DeclListNode *CurNode = dyn_cast<DeclListNode *>(Ptr))
13481348
Ptr = CurNode->Rest;
13491349
else
13501350
Ptr = nullptr;

0 commit comments

Comments
 (0)