Skip to content

C.128: Should destructors be marked "override"? #721

@jaredgrubb

Description

@jaredgrubb

I was using the 'clang-tidy' tool on a codebase and one of its checkers (modernize-use-override) tries to verify that overridden virtual functions are marked 'override'. I was surprised to find that it also flagged destructors.

Putting 'override' on a destructor seems weird to me, but I was curious if I'm the odd one (and I should get used to it) or whether I should submit a patch to clang-tidy to ignore destructors.

Guidelines C.128 does not explicitly mention destructors; I noticed a comment by Titus in Issue #423 that mentions that others find it weird although it is consistent.

In any case, I think C.128 could have an explicit note about how to handle destructors (whichever way is considered preferred).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions