Thread View: gnu.g++.bug
1 messages
1 total messages
Started by chatty%FRLRI61.BITNET
Wed, 30 Aug 1989 12:21
Bug in reference handling? (1.35.1-)
Author: chatty%FRLRI61.BITNET
Date: Wed, 30 Aug 1989 12:21
Date: Wed, 30 Aug 1989 12:21
35 lines
954 bytes
954 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads