Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Do not suggest making destructor 'overriden'

You must be registered to post a reply.
Click here to register.

Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji

Forum code is on.
Html is off.

Check to subscribe to this topic.

T O P I C    R E V I E W
Alexey.Malov Posted - Jun 14 2017 : 09:22:43 AM
There is an option in code inspection settings that suggests declaring overriden function with 'override' specifier. However it has the same behavior for ordinary virtual functions and for virtual destructors.

C++ core guidelines state the following:
C.128: Virtual functions should specify exactly one of virtual, override, or final

However, it has a special remark for destructors:
"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."

It would be nice to have a separate option in Code Inspection Settings for virtual destructors instead of a single option for all.
2   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Sep 26 2017 : 10:58:00 PM
case=103139 is implemented in build 2235
holedigger Posted - Jun 14 2017 : 11:45:36 AM
We are planning on adding an option for this (case=103139).

There are some interesting discussions regarding override on destructors, and there doesn't seem to be consensus. See: https://github.com/isocpp/CppCoreGuidelines/issues/721 and https://github.com/isocpp/CppCoreGuidelines/issues/832.

© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000