public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ethouris at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/31397] Useful compiler warning missing (virtual functions in derived classes used without 'virtual') Date: Wed, 22 May 2013 08:20:00 -0000 [thread overview] Message-ID: <bug-31397-4-DAT8m29Ayl@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-31397-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31397 Michal Malecki <ethouris at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ethouris at gmail dot com --- Comment #15 from Michal Malecki <ethouris at gmail dot com> --- But it would be nice to add a warning, valid in C++11 mode only, when a method is overridden without 'override' keyword, or an overloaded method is defined, which does not override without explicit 'new'. For example, -Wimplicit-override. Additionally, if [[base_check]] has been withdrawn, the same idea can be additionally added as __attribute__((warn_implicit_override)) (or, in C++11, [[gnu::warn_implicit_override]]). I don't think forcing a 'virtual' keyword would do things any better - 'virtual' can always mean starting a new virtual method in this class, which does not override anything.
next prev parent reply other threads:[~2013-05-22 8:20 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-31397-4@http.gcc.gnu.org/bugzilla/> 2011-06-21 16:13 ` redi at gcc dot gnu.org 2011-07-09 12:55 ` ville.voutilainen at gmail dot com 2013-05-22 8:20 ` ethouris at gmail dot com [this message] 2015-01-06 2:05 ` tbsaunde at gcc dot gnu.org 2021-08-11 23:48 ` pinskia at gcc dot gnu.org 2007-03-30 9:49 [Bug c++/31397] New: " Thomas dot Lange at sun dot com 2007-03-30 23:43 ` [Bug c++/31397] " fang at csl dot cornell dot edu 2007-04-07 23:58 ` bangerth at dealii dot org 2009-07-08 10:23 ` Thomas dot Lange at sun dot com 2009-07-08 10:30 ` Thomas dot Lange at sun dot com 2009-07-13 11:48 ` jwakely dot gcc at gmail dot com 2009-07-13 11:57 ` Thomas dot Lange at sun dot com 2009-07-13 12:00 ` rguenth at gcc dot gnu dot org 2009-07-13 12:02 ` Thomas dot Lange at sun dot com 2009-07-13 12:07 ` Thomas dot Lange at sun dot com 2009-07-13 16:47 ` jwakely dot gcc at gmail dot com 2009-07-21 10:51 ` jwakely dot gcc at gmail dot com 2009-08-11 14:16 ` jwakely dot gcc at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-31397-4-DAT8m29Ayl@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).