diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-04-19 01:36:43 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-04-19 01:36:43 +0000 |
commit | 5aacc4021bf3d689cbfd8921666b098441746054 (patch) | |
tree | aca77e5ca9d4e933b32a0a9c64478386b701ddb1 /clang/test/Modules/template-default-args.cpp | |
parent | 6ded58e27962754957834752173aa6ac60f5e1e7 (diff) | |
download | bcm5719-llvm-5aacc4021bf3d689cbfd8921666b098441746054.tar.gz bcm5719-llvm-5aacc4021bf3d689cbfd8921666b098441746054.zip |
[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
Diffstat (limited to 'clang/test/Modules/template-default-args.cpp')
-rw-r--r-- | clang/test/Modules/template-default-args.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Modules/template-default-args.cpp b/clang/test/Modules/template-default-args.cpp index 9d16cbf4342..1d31592fd1f 100644 --- a/clang/test/Modules/template-default-args.cpp +++ b/clang/test/Modules/template-default-args.cpp @@ -44,3 +44,18 @@ H<> h; // expected-error {{default argument of 'H' must be imported from module I<> i; L<> *l; END + +namespace DeferredLookup { + template<typename T, typename U = T> using X = U; + template<typename T> void f() { (void) X<T>(); } + template<typename T> int n = X<T>(); // expected-warning {{extension}} + template<typename T> struct S { X<T> xt; enum E : int; }; + template<typename T> enum S<T>::E : int { a = X<T>() }; + + void test() { + f<int>(); + n<int> = 1; + S<int> s; + S<int>::E e = S<int>::E::a; + } +} |