Douglas Gregor | c8ab256 | 2009-05-31 09:31:02 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | template<typename T> |
| 3 | struct is_pointer { |
| 4 | static const bool value = false; |
| 5 | }; |
| 6 | |
| 7 | template<typename T> |
| 8 | struct is_pointer<T*> { |
| 9 | static const bool value = true; |
| 10 | }; |
| 11 | |
| 12 | template<typename T> |
| 13 | struct is_pointer<const T*> { |
| 14 | static const bool value = true; |
| 15 | }; |
| 16 | |
| 17 | int array0[is_pointer<int>::value? -1 : 1]; |
| 18 | int array1[is_pointer<int*>::value? 1 : -1]; |
| 19 | int array2[is_pointer<const int*>::value? 1 : -1]; // expected-error{{partial ordering}} \ |
| 20 | // expected-error{{negative}} |