2 // { dg-options "-Weffc++" }
4 // Warn when a class has virtual functions and accessible non-virtual
5 // destructor, in which case it would be possible but unsafe to delete
6 // an instance of a derived class through a pointer to the base class.
11 ~A(); // inaccessible - no warning
19 ~B(); // inaccessible - no warning
24 struct C // { dg-warning "non-virtual destructor" }
29 struct D // { dg-warning "non-virtual destructor" }
37 struct F // { dg-warning "non-virtual destructor" }
46 struct G // { dg-warning "non-virtual destructor" }
62 struct J1 : H // { dg-warning "accessible non-virtual destructor" }
67 struct K // { dg-warning "accessible non-virtual destructor" }
72 struct L1 : K // { dg-warning "accessible non-virtual destructor" }