3 // { dg-options "-Wnon-virtual-dtor" }
5 // Warn when a class has virtual functions and accessible non-virtual
6 // destructor, in which case it would be possible but unsafe to delete
7 // an instance of a derived class through a pointer to the base class.
12 ~A(); // inaccessible - no warning
20 ~B(); // inaccessible - no warning
25 struct C // { dg-warning "non-virtual destructor" }
30 struct D // { dg-warning "non-virtual destructor" }
38 struct F // { dg-warning "non-virtual destructor" }
47 struct G // { dg-warning "non-virtual destructor" }
68 struct K // { dg-warning "accessible non-virtual destructor" }
73 struct L1 : K // { dg-warning "accessible non-virtual destructor" }