Path: utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!TOADWAR.UCAR.EDU!gerry From: gerry@TOADWAR.UCAR.EDU (gerry wiener) Newsgroups: gnu.g++.bug Subject: constructor problem with g++1.34 on sun4-os4 Message-ID: <8903301644.AA01395@toadwar.UCAR.EDU> Date: 30 Mar 89 16:44:31 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 43 I believe the following program should print Initialize Hello, world Clean up Instead it prints Hello, world Clean up If the definition of y is placed inside main(), then the program prints Initialize Hello, world Clean up ------------------------------------------------------------------------------ #include class x { public: x(); ~x(); }; x::x() { cout << "Initialize" << "\n"; } x::~x() { cout << "Clean up" << "\n"; } x y; main() { cout << "Hello, world\n"; }