This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31397] Useful compiler warning missing (virtual functions in derived classes used without 'virtual')
- From: "Thomas dot Lange at sun dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2009 11:56:52 -0000
- Subject: [Bug c++/31397] Useful compiler warning missing (virtual functions in derived classes used without 'virtual')
- References: <bug-31397-14335@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from Thomas dot Lange at sun dot com 2009-07-13 11:56 -------
(In reply to comment #5)
No. I do mean overloaded!
It might be nice to have a warning for overloading virtual functions of base
classes as well. But my point is that the compiler should help to enforce that
every virtual function has the 'virtual' keyword set in its declaration.
Thus effectively removing those implicit virtual functions that are allowed in
C++.
The goal is: Either a function should be explicitly declared virtual in its
declaration or not be virtual at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31397