isocpp / isocpp/CppCoreGuidelines

C.128, why not use override virutal base class destructor?

Open
#1,000 5 comments 6 reactions 1 assignee View on GitHub

@gdr-at-ms is already working on this.

Since Jul 31, 2017.

Dominant language
CSS
Stars
45.3k
Forks
5.6k
PR merge metrics
No merged PRs in 30d

Description

From rule C.128

If a base class destructor is declared virtual, one should avoid declaring derived class destructors virtual or override. Some code base and tools might insist on override for destructors, but that is not the recommendation of these guidelines.

Can please someone help me to figure out why a destructor in a derived calls should not be declared override if the destructor is declared virtual in the base class.

Actually, this looks to me to be in contrast to the example in rule C.128. Maybe it is worth to address it in a separate rule.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.