🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ron Guilmette Thu, 08 Jun 1989 22:12
BUG in G++ 1.35.0 (a036)
#2077
Author: Ron Guilmette
Date: Thu, 08 Jun 1989 22:12
39 lines
1775 bytes
Using G++ 1.35.0/Sun3, the following code gets the errors shown
below the code.  If the definition of "function" is moved to a
point *below* the declaration of the class "base", the errors
go away.

-----------------------------------------------------------------
// Check that a global level function which has already been
// either declared or defines may subsequently be declared
// to also be a friend of some class.
//
// This generates an error in G++ 1.35.0


int function (int i, int j)
{
	return i + j;
}

struct base {
	int member;

	friend int function (int, int);
};

int main ()
{
	return 0;
}
-------------------------------------------------------------------
g++-1.35.0.0 -g -Wall -Wwrite-strings -v -S a036.C
g++ version 1.35.0
 /usr/local/src/lib/sun3/g++-1.35.0.0/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Wall -D__HAVE_68881__ -Dmc68020 a036.C /tmp/cca11336.cpp
GNU CPP version 1.35
 /usr/local/src/lib/sun3/g++-1.35.0.0/gcc-cc1plus /tmp/cca11336.cpp -quiet -dumpbase a036.C -Wall -Wwrite-strings -noreg -version -G -o a036.s
GNU C++ version 1.35.0 (68k, MIT syntax) compiled by GNU C version 1.35.
a036.C:16: friend `function' implicitly overloaded
a036.C:9: after declaration of non-overloaded `int function (int, int)'
a036.C:16: warning: `int function (int, int)' declared but never defined
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