diff options
author | John McCall <rjmccall@apple.com> | 2010-11-10 02:40:36 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-10 02:40:36 +0000 |
commit | 9b72f89f0fade44dc431fdb9557523439f98ae11 (patch) | |
tree | c1c0760cdd280859cddd41d2bdf96d508fc9104c /clang/test/SemaCXX/using-decl-1.cpp | |
parent | a4ceea8cd86c4fc649c7c79499ae9dddb9ea20e0 (diff) | |
download | bcm5719-llvm-9b72f89f0fade44dc431fdb9557523439f98ae11.tar.gz bcm5719-llvm-9b72f89f0fade44dc431fdb9557523439f98ae11.zip |
Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former. Fixes PR8022.
llvm-svn: 118669
Diffstat (limited to 'clang/test/SemaCXX/using-decl-1.cpp')
-rw-r--r-- | clang/test/SemaCXX/using-decl-1.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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 <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}} + }; +} |