From 77212133072dc40f070a280af8217032f55a9eb4 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Tue, 15 Dec 2009 18:49:47 +0000 Subject: Update clang to 91430. --- .../instantiate-default-assignment-operator.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/SemaTemplate/instantiate-default-assignment-operator.cpp (limited to 'test/SemaTemplate/instantiate-default-assignment-operator.cpp') diff --git a/test/SemaTemplate/instantiate-default-assignment-operator.cpp b/test/SemaTemplate/instantiate-default-assignment-operator.cpp new file mode 100644 index 0000000..b0ac078 --- /dev/null +++ b/test/SemaTemplate/instantiate-default-assignment-operator.cpp @@ -0,0 +1,17 @@ +// RUN: clang-cc -fsyntax-only -verify %s +template struct PassRefPtr { }; +template struct RefPtr { + RefPtr& operator=(const RefPtr&) { int a[sizeof(T) ? -1 : -1];} // expected-error 2 {{array size is negative}} + RefPtr& operator=(const PassRefPtr&); +}; + +struct A { RefPtr a; }; +struct B : RefPtr { }; + +void f() { + A a1, a2; + a1 = a2; // expected-note {{instantiation of member function 'RefPtr::operator=' requested here}} + + B b1, b2; + b1 = b2; // expected-note {{in instantiation of member function 'RefPtr::operator=' requested here}} +} -- cgit v1.1