Home | History | Annotate | Download | only in SemaCXX
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 struct A {
      3   virtual ~A();
      4 };
      5 
      6 struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
      7   virtual void f();
      8 
      9   void operator delete (void *, int); // expected-note {{'operator delete' declared here}}
     10 };
     11 
     12 void B::f() { // expected-note {{implicit destructor for 'B' first required here}}
     13 }
     14 
     15 struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
     16   C();
     17   void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
     18 };
     19 
     20 C::C() { }  // expected-note {{implicit destructor for 'C' first required here}}
     21 
     22 struct D : A { // expected-error {{no suitable member 'operator delete' in 'D'}}
     23   void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
     24 };
     25 
     26 void f() {
     27   new D; // expected-note {{implicit destructor for 'D' first required here}}
     28 }
     29 
     30