[Bug c++/57854] Would like to have a warning for virtual overrides without C++11 "override" keyword

nachms+gcc at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 9 18:39:00 GMT 2015


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

Nach <nachms+gcc at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nachms+gcc at gmail dot com

--- Comment #6 from Nach <nachms+gcc at gmail dot com> ---
(In reply to Jonathan Wakely from comment #2)
> (In reply to Thiago Macieira from comment #0)
> > 
> > It should be in -Weffc++.
> 
> Not unless a new C++11 edition of Effective C++ recommends using override on
> all overriding functions, and not unless we update -Weffc++ to correspond to
> something other than the first edition.
> 

Modern Effective C++ Item 12 is that every virtual derived function should make
use of the override keyword.

Therefore, -Weffc++ should now include this new warning.


More information about the Gcc-bugs mailing list