Skip to content

Commit 3f07af9

Browse files
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#123283)
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 Source to be nonnull.
1 parent 9f627cf commit 3f07af9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/ByteCode/EvaluationResult.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ bool EvaluationResult::checkFullyInitialized(InterpState &S,
160160
return true;
161161

162162
SourceLocation InitLoc;
163-
if (const auto *D = Source.dyn_cast<const Decl *>())
163+
if (const auto *D = dyn_cast<const Decl *>(Source))
164164
InitLoc = cast<VarDecl>(D)->getAnyInitializer()->getExprLoc();
165-
else if (const auto *E = Source.dyn_cast<const Expr *>())
165+
else if (const auto *E = dyn_cast<const Expr *>(Source))
166166
InitLoc = E->getExprLoc();
167167

168168
if (const Record *R = Ptr.getRecord())

0 commit comments

Comments
 (0)