A class with virtual functions has a public destructor that is not virtual, so deleting through a base pointer skips the derived destructor
What it finds
A class with virtual functions is meant to be used through pointers to it; delete base on an object of a derived class with a non-virtual destructor is undefined behaviour and in practice runs only the base destructor. The destructor is made virtual, or protected when objects are never deleted through the base. Classes with base classes, which may have a virtual destructor already, final classes and classes with macros among their members are left alone.
From the rule's source, virtual_functions_without_virtual_destructor.rs.
Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/cpp:virtual-functions-without-virtual-destructor" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/cpp:virtual-functions-without-virtual-destructor] reason="..."tx0 explain tx0/cpp:virtual-functions-without-virtual-destructor shows the same in the terminal. Found a false positive? Report it.