Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!MCC.COM!rfg From: rfg@MCC.COM (Ron Guilmette) Newsgroups: gnu.g++.bug Subject: BUG in G++ 1.35.0 (a036) Message-ID: <8906082212.AA11343@pink.aca.mcc.com> Date: 8 Jun 89 22:12:15 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 39 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