Reputation: 4339
Anyone know of a tool that can find non-virtual destructors of polymorphic base classes?
Upvotes: 2
Views: 296
Reputation: 36061
It looks like cpplint from google will check this and other C++ style things. If you just want to check virtual destructors cpplint --filter=-,+runtime/virtual
will limit the reported problems to just those.
Upvotes: 0
Reputation: 35911
gcc -Wall
will print messages like
class x has virtual functions but non-virtual destructor
Upvotes: 0
Reputation: 254651
Compiling with g++ -Wall
will give a warning about that. Or -Wnon-virtual-dtor
if you just want that warning.
Upvotes: 6