summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/dependent-names.cpp
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
commitcbebd6226dbdd796ed35b40bd35aeb60bf1ada09 (patch)
treec3ea2c93a53e08f14609aa1864ab99a4919027d9 /clang/test/SemaTemplate/dependent-names.cpp
parentf66f7612bf6a0f6f6085056c2083870981d7c2a0 (diff)
downloadbcm5719-llvm-cbebd6226dbdd796ed35b40bd35aeb60bf1ada09.tar.gz
bcm5719-llvm-cbebd6226dbdd796ed35b40bd35aeb60bf1ada09.zip
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. llvm-svn: 332291
Diffstat (limited to 'clang/test/SemaTemplate/dependent-names.cpp')
-rw-r--r--clang/test/SemaTemplate/dependent-names.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-names.cpp b/clang/test/SemaTemplate/dependent-names.cpp
index 070c7e410f1..05ef33b535a 100644
--- a/clang/test/SemaTemplate/dependent-names.cpp
+++ b/clang/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}}
+ }
+}
OpenPOWER on IntegriCloud