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++/52184] Wrong object initialization in


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52184

--- Comment #2 from Kamil <kamil.holubicki at gmail dot com> 2012-02-09 16:46:55 UTC ---
Base virtual class object is corrupted when explicitly called auto generated
constructor from derived class inititalization list. 
Attached file demonstrates problem.

The only difference between constructors of Derived class is that first one
explicitly states which Base1 constructor should be called. I would expect that
both cout in main() print 8. Unfortunately the first one prints 0.

f I enable explicit definition of Base1 constructor it fixes the problem. If I
remove virtual inheritance in Derived class definition (class Derived: public
A1, public A2) it works as well.

Tested also on 4.6.1 version - issue still exist. Does not exist on 3.4.4.


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