diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-02-01 21:35:00 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-02-01 21:35:00 +0000 |
| commit | 123063377428540752bad91c7fbd536a762e31bd (patch) | |
| tree | f131a156bf0b3912bc02dd7adaf4898c01c8a119 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
| parent | d1b6c770bea9b3da66c6c1eb9a7c483ed7e55c1e (diff) | |
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
| -rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 48d8b94af153..200775756d3a 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -4996,8 +4996,12 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, NamedDecl *Result = nullptr; // FIXME: If the name is a dependent name, this lookup won't necessarily // find it. Does that ever matter? - if (D->getDeclName()) { - DeclContext::lookup_result Found = ParentDC->lookup(D->getDeclName()); + if (auto Name = D->getDeclName()) { + DeclarationNameInfo NameInfo(Name, D->getLocation()); + Name = SubstDeclarationNameInfo(NameInfo, TemplateArgs).getName(); + if (!Name) + return nullptr; + DeclContext::lookup_result Found = ParentDC->lookup(Name); Result = findInstantiationOf(Context, D, Found.begin(), Found.end()); } else { // Since we don't have a name for the entity we're looking for, |
