[modules] Properly look up the owning module for an instantiation of a merged template.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 19 Apr 2017 01:36:43 +0000 (01:36 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 19 Apr 2017 01:36:43 +0000 (01:36 +0000)
commit5aacc4021bf3d689cbfd8921666b098441746054
treeaca77e5ca9d4e933b32a0a9c64478386b701ddb1
parent6ded58e27962754957834752173aa6ac60f5e1e7
[modules] Properly look up the owning module for an instantiation of a merged template.

When looking for the template instantiation pattern of a templated entity,
consistently select the definition of the pattern if there is one. This means
we'll pick the same owning module when we start instantiating a template that
we'll later pick when determining which modules are visible during that
instantiation.

llvm-svn: 300650
clang/lib/AST/Decl.cpp
clang/lib/AST/DeclCXX.cpp
clang/lib/Sema/SemaLookup.cpp
clang/test/Modules/Inputs/template-default-args/a.h
clang/test/Modules/template-default-args.cpp