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++/78010] New: --Wsuggest-override reports a redundant warning on a 'final' method


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010

            Bug ID: 78010
           Summary: --Wsuggest-override reports a redundant warning on a
                    'final' method
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: a.volkov at rusbitech dot ru
  Target Milestone: ---

Hi,

gcc reports a warning on a 'final' method which is not specified as 'virtual':
struct A {
  virtual void f();
};
struct B : A {
  void f() final;
};

There is no need to suggest adding override for B::f(): without the 'virtual'
specifier 'final' means that B::f() is an overrider.

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