aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/destructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r--test/SemaCXX/destructor.cpp17
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() {}
+}