Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!rocket!dove From: rocket!dove@UUNET.UU.NET (Webster Dove) Newsgroups: gnu.g++.bug Subject: 1.32.0 base initialization ignores virtuality Message-ID: <8904140408.AA08129@rocket.sanders.com> Date: 14 Apr 89 04:08:24 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 43 The following program prints base base base derived and should (I think) print base base derived derived This happens with cfront also. Why? (Please reply via mail) // -*- C++ -*- #include class base { public: virtual void foo() { cout << "base"; } base() { foo(); } }; class derived : base { public: virtual void foo() { cout << "derived"; } derived() {}; }; main() { base x; x.foo(); derived y; // Prints "base" should print "derived". y.foo(); }