Anders Carlsson | b6cc91b | 2009-12-09 03:01:51 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | template<typename> struct PassRefPtr { }; |
| 3 | template<typename T> struct RefPtr { |
| 4 | RefPtr& operator=(const RefPtr&) { int a[sizeof(T) ? -1 : -1];} // expected-error 2 {{array size is negative}} |
| 5 | RefPtr& operator=(const PassRefPtr<T>&); |
| 6 | }; |
| 7 | |
| 8 | struct A { RefPtr<int> a; }; |
| 9 | struct B : RefPtr<float> { }; |
| 10 | |
| 11 | void f() { |
| 12 | A a1, a2; |
| 13 | a1 = a2; // expected-note {{instantiation of member function 'RefPtr<int>::operator=' requested here}} |
| 14 | |
| 15 | B b1, b2; |
| 16 | b1 = b2; // expected-note {{in instantiation of member function 'RefPtr<float>::operator=' requested here}} |
| 17 | } |