Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!cernvax!chx400!bernina!tilo From: tilo@bernina.ethz.ch (Tilo Levante) Newsgroups: comp.std.c++ Subject: Re: Calling constructors for parms passed by value Message-ID: <1991Feb5.073657.6030@bernina.ethz.ch> Date: 5 Feb 91 07:36:57 GMT References: <631@necssd.NEC.COM> Organization: Swiss Federal Institute of Technology (ETH), Zurich Lines: 39 The g++, tc++, ... compilers are correct. You missed the (default) copy constructor. If you write your program this way, you will see it: #include class bug { public: bug() { cout << "in constructor\n"; } bug(const bug& a) { cout << "in copy constructor\n"; } ~bug() { cout << "in destructor\n"; } }; foo(bug a, bug b) { cout << "in foo\n"; } main() { bug a,b; foo(a,b); } The output is: in constructor in constructor in copy constructor in copy constructor in foo in destructor in destructor in destructor in destructor I assume that cfront has a bug in this case. It has to destruct the value parameters. Tilo