diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-12 21:21:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-12 21:21:02 +0000 |
commit | e94866ffc12d33d30b351f30aac4aa3828bc05d7 (patch) | |
tree | 093ed36b2a82d220682404c1bb41d55cbf813d4c /test/SemaTemplate/temp_class_spec.cpp | |
parent | 0b32600195ad729de9e78f073aa509cd9991d52e (diff) |
Diagnose the incorrect use of non-type template arguments for class
template partial specializations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_class_spec.cpp')
-rw-r--r-- | test/SemaTemplate/temp_class_spec.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/test/SemaTemplate/temp_class_spec.cpp b/test/SemaTemplate/temp_class_spec.cpp index 0d83a9bcc3..ce1459b1d2 100644 --- a/test/SemaTemplate/temp_class_spec.cpp +++ b/test/SemaTemplate/temp_class_spec.cpp @@ -255,48 +255,3 @@ int is_nested_value_type_identity1[ //int is_nested_value_type_identity2[ // is_nested_value_type_identity<NoValueType>::value? -1 : 1]; -// FIXME: The tests that follow are stress-tests for the substitution -// of deduced template arguments into the template argument list of a -// partial specialization. I believe that we'll need this code for -// substitution into function templates, but note that the examples -// below are ill-formed and should eventually be removed. -template<typename T, int N> -struct is_sizeof_T { - static const bool value = false; -}; - -template<typename T> -struct is_sizeof_T<T, sizeof(T)> { - static const bool value = true; -}; - -int is_sizeof_T0[is_sizeof_T<int, sizeof(int)>::value? 1 : -1]; -int is_sizeof_T1[is_sizeof_T<int, sizeof(char)>::value? -1 : 1]; - -template<typename T> -struct HasStaticOfT { - static T value; - static T other_value; -}; - -struct DerivedStaticOfInt : HasStaticOfT<int> { }; - -template<typename X, typename T, T *Ptr> -struct is_static_int_val { - static const bool value = false; -}; - -template<typename X, typename T> -struct is_static_int_val<X, T, &X::value> { - static const bool value = true; -}; - -int is_static_int_val0[ - is_static_int_val<HasStaticOfT<int>, int, - &HasStaticOfT<int>::value>::value ? 1 : -1]; -int is_static_int_val1[ - is_static_int_val<HasStaticOfT<int>, int, - &HasStaticOfT<int>::other_value>::value ? -1 : 1]; -int is_static_int_val2[ - is_static_int_val<DerivedStaticOfInt, int, - &HasStaticOfT<int>::value>::value ? 1 : -1]; |