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 | 78b810559d89e996e00684335407443936ce34a1 (patch) | |
tree | 9640f331e67082f04c10f307eb19807881ca2b26 /test/SemaCXX/using-directive.cpp | |
parent | 1397399de1cff90e0cb3b1d72097d34bd1a11759 (diff) |
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
Diffstat (limited to 'test/SemaCXX/using-directive.cpp')
-rw-r--r-- | test/SemaCXX/using-directive.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/using-directive.cpp b/test/SemaCXX/using-directive.cpp index 162f7fa07a..22c6e14ce5 100644 --- a/test/SemaCXX/using-directive.cpp +++ b/test/SemaCXX/using-directive.cpp @@ -126,3 +126,10 @@ void f4() { f2(1); } using namespace std; // expected-warning{{using directive refers to implicitly-defined namespace 'std'}} using namespace ::std; // expected-warning{{using directive refers to implicitly-defined namespace 'std'}} +namespace test1 { + namespace ns { typedef int test1; } + template <class T> using namespace ns; // expected-error {{cannot template a using directive}} + + // Test that we recovered okay. + test1 x; +} |