summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-05-14 20:52:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-05-14 20:52:48 +0000
commite8fbde0fe56a245db6f985c48a0b9cab1be53ecd (patch)
treec24fcaba2843cb471634d622b6ae6ce864afed2b /test/SemaTemplate
parent07fe64cddfe450fb0b1716958a04758f4b2ceae7 (diff)
downloadclang-e8fbde0fe56a245db6f985c48a0b9cab1be53ecd.tar.gz
Fix regression in r332076.
If the name after 'template' is an unresolved using declaration (not containing 'typename'), then we don't yet know if it's a valid template-name, so don't reject it prior to instantiation. Instead, treat it as naming a dependent member of the current instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/dependent-names.cpp20
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}}
+ }
+}