summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-10-18 01:41:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-10-18 01:41:38 +0000
commit5920af940999e0ef4041735c53d828cac90ef1fc (patch)
treeae7ebc918337f2824598efdba1877b75f4d2439d /lib/Sema/SemaLookup.cpp
parentd5aad901c029f9723373809ef0f2314be50167a0 (diff)
[modules] When finding the owning module of an instantiated context in template
instantiation, follow lexical parents not semantic ones: we want to find the module where the pattern was written. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 827c7012bc..73aceaaf94 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -1374,7 +1374,7 @@ static Module *getDefiningModule(Sema &S, Decl *Entity) {
// Walk up to the containing context. That might also have been instantiated
// from a template.
- DeclContext *Context = Entity->getDeclContext();
+ DeclContext *Context = Entity->getLexicalDeclContext();
if (Context->isFileContext())
return S.getOwningModule(Entity);
return getDefiningModule(S, cast<Decl>(Context));