Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!CUNYVM.CUNY.EDU!chatty%FRLRI61.BITNET From: chatty%FRLRI61.BITNET@CUNYVM.CUNY.EDU Newsgroups: gnu.g++.bug Subject: Bug in reference handling? (1.35.1-) Message-ID: <8908301221.AA05398@lri.lri.fr> Date: 30 Aug 89 12:21:23 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 35 In the following code, the function foo is called each time the reference x is u I use g++ 1.35.1- on a Sun3 OS3.5. class A { public : void bar () {} }; A& foo () { printf ("foo\n"); return *(new A); } main () { A& x = foo (); x.bar (); x.bar (); } % g++ a.cc In function struct A &foo (): a.cc:9: warning: implicit declaration of function `printf' % a.out foo foo foo Stephane Chatty chatty@frlri61.bitnet chatty@lri.lri.fr