From 9b72f89f0fade44dc431fdb9557523439f98ae11 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 10 Nov 2010 02:40:36 +0000 Subject: Diagnose attempst to template using declarations and using directives. Recover from the latter and fail early for the former. Fixes PR8022. llvm-svn: 118669 --- clang/test/SemaCXX/using-decl-1.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'clang/test/SemaCXX/using-decl-1.cpp') diff --git a/clang/test/SemaCXX/using-decl-1.cpp b/clang/test/SemaCXX/using-decl-1.cpp index 30c4cfd997a..65be0bc3aae 100644 --- a/clang/test/SemaCXX/using-decl-1.cpp +++ b/clang/test/SemaCXX/using-decl-1.cpp @@ -95,3 +95,16 @@ namespace test1 { foo(p); // expected-error {{no matching function}} } } + +namespace test2 { + namespace ns { int foo; } + template using ns::foo; // expected-error {{cannot template a using declaration}} + + // PR8022 + struct A { + template void f(T); + }; + class B : A { + template using A::f; // expected-error {{cannot template a using declaration}} + }; +} -- cgit v1.2.3