This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]