Skip to content

Rule: Polymorphic type has a non-virtual destructor

Canonical rule slug: polymorphic-nonvirtual-dtor. ← back to all rules

A type with virtual functions is destroyed through a base pointer without a virtual destructor, so derived state is never destroyed.

Canonical demonstration