summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/class-template-spec.cpp3
-rw-r--r--clang/test/SemaTemplate/instantiation-default-1.cpp2
-rw-r--r--clang/test/SemaTemplate/temp_class_spec.cpp20
3 files changed, 21 insertions, 4 deletions
diff --git a/clang/test/SemaTemplate/class-template-spec.cpp b/clang/test/SemaTemplate/class-template-spec.cpp
index b3dc3b2dca2..71d8ea14be6 100644
--- a/clang/test/SemaTemplate/class-template-spec.cpp
+++ b/clang/test/SemaTemplate/class-template-spec.cpp
@@ -52,9 +52,6 @@ A<char>::A() { }
// Diagnose specialization errors
struct A<double> { }; // expected-error{{template specialization requires 'template<>'}}
-template<typename T> // expected-error{{class template partial specialization is not yet supported}}
-struct A<T*> { };
-
template<> struct ::A<double>;
namespace N {
diff --git a/clang/test/SemaTemplate/instantiation-default-1.cpp b/clang/test/SemaTemplate/instantiation-default-1.cpp
index ecb1fb73f90..f0ce0d3cc66 100644
--- a/clang/test/SemaTemplate/instantiation-default-1.cpp
+++ b/clang/test/SemaTemplate/instantiation-default-1.cpp
@@ -36,7 +36,7 @@ typedef int& int_ref_t;
Def2<int_ref_t> *d2; // expected-note{{in instantiation of default argument for 'Def2<int &>' required here}}
-template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1'}}
+template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1<int const>'}}
template<typename T, typename T2 = T&> struct Def3;
diff --git a/clang/test/SemaTemplate/temp_class_spec.cpp b/clang/test/SemaTemplate/temp_class_spec.cpp
new file mode 100644
index 00000000000..df652b5ba38
--- /dev/null
+++ b/clang/test/SemaTemplate/temp_class_spec.cpp
@@ -0,0 +1,20 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+template<typename T>
+struct is_pointer {
+ static const bool value = false;
+};
+
+template<typename T>
+struct is_pointer<T*> {
+ static const bool value = true;
+};
+
+template<typename T>
+struct is_pointer<const T*> {
+ static const bool value = true;
+};
+
+int array0[is_pointer<int>::value? -1 : 1];
+int array1[is_pointer<int*>::value? 1 : -1];
+int array2[is_pointer<const int*>::value? 1 : -1]; // expected-error{{partial ordering}} \
+// expected-error{{negative}}
OpenPOWER on IntegriCloud