diff options
author | John McCall <rjmccall@apple.com> | 2010-07-03 18:33:00 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-07-03 18:33:00 +0000 |
commit | 5efd91a3b58e59006f8a3e8c9256ec00c38dba95 (patch) | |
tree | 5f2d099e8b2ab8023914fa8e2445be3d73f9223c /test/SemaCXX/destructor.cpp | |
parent | 4d254836f4a6a03fb3c77d0636c3cb5475540eb0 (diff) |
Mark the operator delete associated with a virtual destructor as referenced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r-- | test/SemaCXX/destructor.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp index 3c63c3d36a..2c60b32204 100644 --- a/test/SemaCXX/destructor.cpp +++ b/test/SemaCXX/destructor.cpp @@ -88,3 +88,20 @@ namespace PR6709 { struct X0 { virtual ~X0() throw(); }; struct X1 : public X0 { }; + +// Make sure we instantiate operator deletes when building a virtual +// destructor. +namespace test6 { + template <class T> class A { + public: + void *operator new(unsigned long); + void operator delete(void *p) { + T::deleteIt(p); // expected-error {{type 'int' cannot be used prior to '::'}} + } + + virtual ~A() {} // expected-note {{in instantiation of member function 'test6::A<int>::operator delete' requested here}} + }; + + class B : A<int> { B(); }; + B::B() {} +} |