2010-01-01 10:34:51 +00:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-12-15 18:49:47 +00:00
|
|
|
struct A {
|
|
|
|
virtual ~A();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
|
|
|
|
virtual void f();
|
|
|
|
|
|
|
|
void operator delete (void *, int); // expected-note {{'operator delete' declared here}}
|
|
|
|
};
|
|
|
|
|
2010-03-10 17:45:58 +00:00
|
|
|
void B::f() { // expected-note {{implicit default destructor for 'B' first required here}}
|
2009-12-15 18:49:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
|
|
|
|
C();
|
|
|
|
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
|
2010-03-03 17:28:16 +00:00
|
|
|
};
|
2009-12-15 18:49:47 +00:00
|
|
|
|
2010-03-10 17:45:58 +00:00
|
|
|
C::C() { } // expected-note {{implicit default destructor for 'C' first required here}}
|
2009-12-15 18:49:47 +00:00
|
|
|
|
|
|
|
struct D : A { // expected-error {{no suitable member 'operator delete' in 'D'}}
|
|
|
|
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
|
2010-03-10 17:45:58 +00:00
|
|
|
}; // expected-note {{implicit default destructor for 'D' first required here}}
|
2009-12-15 18:49:47 +00:00
|
|
|
|
|
|
|
void f() {
|
2010-01-15 15:39:40 +00:00
|
|
|
new D;
|
2009-12-15 18:49:47 +00:00
|
|
|
}
|
|
|
|
|