Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former. Fixes PR8022.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118669 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp
index 30c4cfd..65be0bc 100644
--- a/test/SemaCXX/using-decl-1.cpp
+++ b/test/SemaCXX/using-decl-1.cpp
@@ -95,3 +95,16 @@
foo(p); // expected-error {{no matching function}}
}
}
+
+namespace test2 {
+ namespace ns { int foo; }
+ template <class T> using ns::foo; // expected-error {{cannot template a using declaration}}
+
+ // PR8022
+ struct A {
+ template <typename T> void f(T);
+ };
+ class B : A {
+ template <typename T> using A::f<T>; // expected-error {{cannot template a using declaration}}
+ };
+}