Skip to content

Commit 63c59dd

Browse files
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#125630)
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 *Found to be nonnull. Note that if *Found were null, cast<VarDecl>(TransformedDecl) would trigger an assertion error.
1 parent 97f6e53 commit 63c59dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaTemplateInstantiate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,7 @@ TemplateInstantiator::TransformFunctionParmPackRefExpr(DeclRefExpr *E,
24382438
assert(Found && "no instantiation for parameter pack");
24392439

24402440
Decl *TransformedDecl;
2441-
if (DeclArgumentPack *Pack = Found->dyn_cast<DeclArgumentPack *>()) {
2441+
if (DeclArgumentPack *Pack = dyn_cast<DeclArgumentPack *>(*Found)) {
24422442
// If this is a reference to a function parameter pack which we can
24432443
// substitute but can't yet expand, build a FunctionParmPackExpr for it.
24442444
if (getSema().ArgumentPackSubstitutionIndex == -1) {

0 commit comments

Comments
 (0)