Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Do not suggest making destructor 'overriden'
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Alexey.Malov
New Member

Russia
4 Posts

Posted - Jun 14 2017 :  09:22:43 AM  Show Profile  Reply with Quote
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
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final

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

holedigger
Whole Tomato Software

145 Posts

Posted - Jun 14 2017 :  11:45:36 AM  Show Profile  Reply with Quote
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.

Whole Tomato Software
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 26 2017 :  10:58:00 PM  Show Profile  Reply with Quote
case=103139 is implemented in build 2235
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000