diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-04 04:11:30 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-04 04:11:30 +0000 |
commit | 4d6fb501ffc0568ca5ca7266005e96a6f1273845 (patch) | |
tree | d7b02276b7a5649fd6a8f12860d2c4cf8bdfccae /test/SemaTemplate/temp_class_spec.cpp | |
parent | fb6fa30a9b06670deb14f862dddbc49a12552939 (diff) |
Template argument deduction for incomplete and constant array types. Doug, please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_class_spec.cpp')
-rw-r--r-- | test/SemaTemplate/temp_class_spec.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_class_spec.cpp b/test/SemaTemplate/temp_class_spec.cpp index 710fa4ada5..d516f01d7f 100644 --- a/test/SemaTemplate/temp_class_spec.cpp +++ b/test/SemaTemplate/temp_class_spec.cpp @@ -49,3 +49,33 @@ int is_same0[is_same<int, int>::value? 1 : -1]; int is_same1[is_same<int, INT>::value? 1 : -1]; int is_same2[is_same<const int, int>::value? -1 : 1]; int is_same3[is_same<int_ptr, int>::value? -1 : 1]; + +template<typename T> +struct is_incomplete_array { + static const bool value = false; +}; + +template<typename T> +struct is_incomplete_array<T[]> { + static const bool value = true; +}; + +int incomplete_array0[is_incomplete_array<int>::value ? -1 : 1]; +int incomplete_array1[is_incomplete_array<int[1]>::value ? -1 : 1]; +int incomplete_array2[is_incomplete_array<bool[]>::value ? 1 : -1]; +int incomplete_array3[is_incomplete_array<int[]>::value ? 1 : -1]; + +template<typename T> +struct is_array_with_4_elements { + static const bool value = false; +}; + +template<typename T> +struct is_array_with_4_elements<T[4]> { + static const bool value = true; +}; + +int array_with_4_elements0[is_array_with_4_elements<int[]>::value ? -1 : 1]; +int array_with_4_elements1[is_array_with_4_elements<int[1]>::value ? -1 : 1]; +int array_with_4_elements2[is_array_with_4_elements<int[4]>::value ? 1 : -1]; +int array_with_4_elements3[is_array_with_4_elements<int[4][2]>::value ? 1 : -1]; |