waffleman
waffleman

Reputation: 4339

Tool for finding non-virtual destructors

Anyone know of a tool that can find non-virtual destructors of polymorphic base classes?

Upvotes: 2

Views: 296

Answers (3)

Geoff Reedy
Geoff Reedy

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

stijn
stijn

Reputation: 35911

gcc -Wall

will print messages like

class x has virtual functions but non-virtual destructor

Upvotes: 0

Mike Seymour
Mike Seymour

Reputation: 254651

Compiling with g++ -Wall will give a warning about that. Or -Wnon-virtual-dtor if you just want that warning.

Upvotes: 6

Related Questions