This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13064] getting address of a virtual base before its construction causes a crash
- 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: 16 Nov 2003 03:08:55 -0000
- Subject: [Bug c++/13064] getting address of a virtual base before its construction causes a crash
- References: <20031116002702.13064.joseph@dkd.lt>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-16 03:08 -------
Yes 12.7.2 :
To explicitly or implicitly convert a pointer (an lvalue) refering to an object of class X to a pointer
(reference) to a direct or indirect base class B of X, the construction of X and the construction of all
of its direct or indirect bases that directly or indirectly derive from B shall have started and the
destruction of these classes shall not have completed, otherwise the conversion results in
undefined behavior.
In your example the construtor of b have not started yet.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13064