diff options
Diffstat (limited to 'test/SemaTemplate/dependent-names.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-names.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-names.cpp b/test/SemaTemplate/dependent-names.cpp index 070c7e410f..05ef33b535 100644 --- a/test/SemaTemplate/dependent-names.cpp +++ b/test/SemaTemplate/dependent-names.cpp @@ -427,3 +427,23 @@ namespace DependentTemplateIdWithNoArgs { }; void g() { f<X>(); } } + +namespace DependentUnresolvedUsingTemplate { + template<typename T> + struct X : T { + using T::foo; + void f() { this->template foo(); } // expected-error {{does not refer to a template}} + void g() { this->template foo<>(); } // expected-error {{does not refer to a template}} + void h() { this->template foo<int>(); } // expected-error {{does not refer to a template}} + }; + struct A { template<typename = int> int foo(); }; + struct B { int foo(); }; // expected-note 3{{non-template here}} + void test(X<A> xa, X<B> xb) { + xa.f(); + xa.g(); + xa.h(); + xb.f(); // expected-note {{instantiation of}} + xb.g(); // expected-note {{instantiation of}} + xb.h(); // expected-note {{instantiation of}} + } +} |