Douglas Gregor | 8e458f4 | 2009-02-09 18:46:07 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | template<typename T> struct A { }; |
| 3 | |
| 4 | typedef A<int> A_int; |
| 5 | |
| 6 | float *foo(A<int> *ptr, A<int> const *ptr2) { |
| 7 | if (ptr) |
| 8 | return ptr; // expected-error{{incompatible type returning 'A<int> *', expected 'float *'}} |
| 9 | else if (ptr2) |
| 10 | return ptr2; // expected-error{{incompatible type returning 'A<int> const *', expected 'float *'}} |
| 11 | else { |
| 12 | // FIXME: This is completely bogus, but we're using it temporarily |
| 13 | // to test the syntactic sugar for class template specializations. |
| 14 | int *ip = ptr; |
| 15 | return 0; |
| 16 | } |
| 17 | } |