This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37065] Virtual function from member constructor and destructor
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Aug 2008 07:39:17 -0000
- Subject: [Bug c++/37065] Virtual function from member constructor and destructor
- References: <bug-37065-16577@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-08-10 07:39 -------
Nope, GCC's behavior is correct according to the C++ standard:
12.7/3:
When a virtual function is called directly or indirectly from a constructor
(including from the mem-initializer for a data member) or from a destructor,
and the object to which the call applies is the object under construction or
destruction, the function called is the one define in the constructor or
destructor's own class or in one of its bases, but not a function overiding it
in a class derived from the constructor or destructor's class or overriding it
in one of the other base classes of the most derived object (1.8).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37065