This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78010] New: --Wsuggest-override reports a redundant warning on a 'final' method
- From: "a.volkov at rusbitech dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Oct 2016 13:25:57 +0000
- Subject: [Bug c++/78010] New: --Wsuggest-override reports a redundant warning on a 'final' method
- Auto-submitted: auto-generated
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.