warn about polymorphic classes (which have virtual functions) rather
than dynamic classes (which are polymorphic or have virtual bases).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126036
91177308-0d34-0410-b5e6-
96231b3b80d8
}
// Warn if the class has virtual methods but non-virtual public destructor.
- if (Record->isDynamicClass() && !Record->isDependentType()) {
+ if (Record->isPolymorphic() && !Record->isDependentType()) {
CXXDestructorDecl *dtor = Record->getDestructor();
if (!dtor || (!dtor->isVirtual() && dtor->getAccess() == AS_public))
Diag(dtor ? dtor->getLocation() : Record->getLocation(),
TS2<int> foo; // expected-note {{instantiation}}
}
+
+namespace PR9238 {
+ class B { public: ~B(); };
+ class C : virtual B { public: ~C() { } };
+}