public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98864] New: Warning for unnecessary final keyword
@ 2021-01-28 13:14 drepper.fsp+rhbz at gmail dot com
2021-01-28 15:39 ` [Bug c++/98864] " mpolacek at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: drepper.fsp+rhbz at gmail dot com @ 2021-01-28 13:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98864
Bug ID: 98864
Summary: Warning for unnecessary final keyword
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: drepper.fsp+rhbz at gmail dot com
Target Milestone: ---
Compile the following code:
struct foo {
virtual void f();
};
struct bar final : foo {
void f() final override;
};
It is correct and should compile but the function bar::f is annotated with
'final' even though the entire class is also annotated with 'final'. This adds
nothing and might be an indication of misunderstanding or leftovers from
previous versions of the code.
Perhaps a warning can be added to point out the issue.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-28 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 13:14 [Bug c++/98864] New: Warning for unnecessary final keyword drepper.fsp+rhbz at gmail dot com
2021-01-28 15:39 ` [Bug c++/98864] " mpolacek at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).