Skip to content

Commit 967b4d0

Browse files
committed
fix
1 parent ace77c2 commit 967b4d0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7060,8 +7060,15 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
70607060
// anonymous unions in class templates).
70617061
}
70627062

7063-
if (!ParentDependsOnArgs)
7063+
if (!ParentDependsOnArgs) {
7064+
if (auto Found =
7065+
CurrentInstantiationScope
7066+
? CurrentInstantiationScope->getInstantiationOfIfExists(D)
7067+
: nullptr) {
7068+
return cast<NamedDecl>(Found->dyn_cast<Decl *>());
7069+
}
70647070
return D;
7071+
}
70657072

70667073
ParentDC = FindInstantiatedContext(Loc, ParentDC, TemplateArgs);
70677074
if (!ParentDC)

0 commit comments

Comments
 (0)