This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/65856] New: -Wsuggest-override shall not report a warning on final method


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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]