Article View: gnu.g++.bug
Article #1815constructor problem with g++1.34 on sun4-os4
From: gerry wiener
Date: Thu, 30 Mar 1989 16:44
Date: Thu, 30 Mar 1989 16:44
43 lines
927 bytes
927 bytes
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 <stream.h>
class x
{
public:
x();
~x();
};
x::x()
{
cout << "Initialize" << "\n";
}
x::~x()
{
cout << "Clean up" << "\n";
}
x y;
main()
{
cout << "Hello, world\n";
}
Technical Details
Message-ID:
<8903301644.AA01395@toadwar.UCAR.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!TOADWAR.UCAR.EDU!gerryShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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