This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33475] New warning suggestion: virtual functions called from constructors/destructors
- From: "gcc at eseidel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2009 01:38:29 -0000
- Subject: [Bug c++/33475] New warning suggestion: virtual functions called from constructors/destructors
- References: <bug-33475-6649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from gcc at eseidel dot com 2009-01-21 01:38 -------
We just hit this when hacking on Chromium code. We were calling a virtual
function from a constructor (unintentionally) and the bug was that GCC was
silently calling the base-class implementation. After consulting the web, it
seems this is correct behavior. It would have ben nice if GCC had warned when
compiling the constructor function that the virtual call would not have worked
"as naively suspected".
Thanks!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33475