2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-12-03 01:15:43 +08: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 19:27:22 +08:00
|
|
|
void B::f() { // expected-note {{implicit default destructor for 'B' first required here}}
|
2009-12-03 01:15:43 +08: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 05:28:26 +08:00
|
|
|
};
|
2009-12-03 01:15:43 +08:00
|
|
|
|
2010-03-10 19:27:22 +08:00
|
|
|
C::C() { } // expected-note {{implicit default destructor for 'C' first required here}}
|
2009-12-03 01:15:43 +08: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 19:27:22 +08:00
|
|
|
}; // expected-note {{implicit default destructor for 'D' first required here}}
|
2009-12-03 01:15:43 +08:00
|
|
|
|
|
|
|
void f() {
|
2010-01-06 12:44:19 +08:00
|
|
|
new D;
|
2009-12-03 01:15:43 +08:00
|
|
|
}
|
|
|
|
|