Skip to content

Commit 8bae15e

Browse files
committed
address comment
1 parent a9379c7 commit 8bae15e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7062,11 +7062,12 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
70627062
}
70637063

70647064
if (!ParentDependsOnArgs) {
7065-
if (auto Found =
7066-
CurrentInstantiationScope
7067-
? CurrentInstantiationScope->getInstantiationOfIfExists(D)
7068-
: nullptr) {
7069-
return cast<NamedDecl>(Found->dyn_cast<Decl *>());
7065+
if (CurrentInstantiationScope) {
7066+
if (llvm::PointerUnion<Decl *, LocalInstantiationScope::DeclArgumentPack *> *Found =
7067+
CurrentInstantiationScope->getInstantiationOfIfExists(D)) {
7068+
if (Decl* FD = Found->dyn_cast<Decl *>())
7069+
return cast<NamedDecl>(FD);
7070+
}
70707071
}
70717072
return D;
70727073
}

0 commit comments

Comments
 (0)