summaryrefslogtreecommitdiff
path: root/test/CXX/temp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-15 02:19:47 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-15 02:19:47 +0000
commit4b2b02b26cd51e2e44fa315143618285fd72ce77 (patch)
treeafaea9b784b9f5ecbd6edf73614f1aa26eabb533 /test/CXX/temp
parent624c7d704dc9f1dbb5dd3e5a0ef7eacfb3b699e2 (diff)
downloadclang-4b2b02b26cd51e2e44fa315143618285fd72ce77.tar.gz
Diagnose the use of typedefs for template specialization types in the scope
specifiers for out-of-line declarations, e.g. typedef Temp<int> MyTemp; template <> MyTemp::foo; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/temp')
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp
index 883cb71d56..06653044c3 100644
--- a/test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp
+++ b/test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp
@@ -10,3 +10,15 @@ template<> template<> class A<int>::B<double>;
template<> template<> void A<char>::B<char>::mf();
template<> void A<char>::B<int>::mf(); // expected-error{{requires 'template<>'}}
+
+namespace test1 {
+ template <class> class A {
+ static int foo;
+ static int bar;
+ };
+ typedef A<int> AA;
+
+ template <> int AA::foo = 0; // expected-error {{cannot use typedef}}
+ int AA::bar = 1; // expected-error {{cannot use typedef}} expected-error {{template specialization requires 'template<>'}}
+ int A<float>::bar = 2; // expected-error {{template specialization requires 'template<>'}}
+}