This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65856] New: -Wsuggest-override shall not report a warning on final method
- From: "thomas.helfer at cea dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Apr 2015 08:37:01 +0000
- Subject: [Bug c++/65856] New: -Wsuggest-override shall not report a warning on final method
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65856
Bug ID: 65856
Summary: -Wsuggest-override shall not report a warning on final
method
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: thomas.helfer at cea dot fr
Hi,
first of all, as this is my first report, I wish to thank all gcc developpers
for their work.
I tried the -Wsuggest-override flag. I found that it suggests adding override
to methods marked final. I think that this shall not be as final methods are
already meant to override a method.
This is only a suggestion. Maybe something in the standard makes it logical to
mark a method as both override and final, but this would seem weird to my
understanding.
Example:
âvirtual const char* tfel::math::InvalidTimeStepException::what() constâ can be
marked override [-Wsuggest-override]
virtual const char* what() const noexcept final;