[Bug c++/13064] getting address of a virtual base before its construction causes a crash

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Nov 16 03:08:00 GMT 2003


------- 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



More information about the Gcc-bugs mailing list