Skip to content

Commit d3c7fb2

Browse files
committed
fix
1 parent 82cf54f commit d3c7fb2

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
@@ -7061,8 +7061,15 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
70617061
// anonymous unions in class templates).
70627062
}
70637063

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

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

0 commit comments

Comments
 (0)