diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:49:47 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:49:47 +0000 |
commit | 34d02d0b37f16015f317a935c48ce8b7b64ae77b (patch) | |
tree | 2fd5819f49caecc5f520219b6b9254fe94ebb138 /test/SemaTemplate/instantiate-default-assignment-operator.cpp | |
parent | 1569ce68681d909594d64f9b056d71f5dd7563bf (diff) |
Notes
Diffstat (limited to 'test/SemaTemplate/instantiate-default-assignment-operator.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-default-assignment-operator.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-default-assignment-operator.cpp b/test/SemaTemplate/instantiate-default-assignment-operator.cpp new file mode 100644 index 000000000000..b0ac078893de --- /dev/null +++ b/test/SemaTemplate/instantiate-default-assignment-operator.cpp @@ -0,0 +1,17 @@ +// RUN: clang-cc -fsyntax-only -verify %s +template<typename> struct PassRefPtr { }; +template<typename T> struct RefPtr { + RefPtr& operator=(const RefPtr&) { int a[sizeof(T) ? -1 : -1];} // expected-error 2 {{array size is negative}} + RefPtr& operator=(const PassRefPtr<T>&); +}; + +struct A { RefPtr<int> a; }; +struct B : RefPtr<float> { }; + +void f() { + A a1, a2; + a1 = a2; // expected-note {{instantiation of member function 'RefPtr<int>::operator=' requested here}} + + B b1, b2; + b1 = b2; // expected-note {{in instantiation of member function 'RefPtr<float>::operator=' requested here}} +} |