HDTenEightyP/NetNews huggingface dataset:
From: mclaugh@tnt.acsys.com (Mark A. McLaughlin)
Subject: G++ Bug
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 15 Dec 1992 21:11:48 GMT

The following bit of code will not compile with g++ version 2.3.2:

   struct BUG {
      BUG(int i);
   };

   BUG B = BUG(0);

It used to work with version 2.3.1.

                                ---- Mark A. McLaughlin
                                     Applied Computing Systems, Inc.
                                     mclaugh@tnt.acsys.com


Newsgroups: gnu.g++.bug
From: dececco@nsl.UUCP
Subject: Bug report for g++ 2.3.2
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 16 Dec 1992 16:48:37 GMT

The following file, compiled with g++ 2.3.2,
on a SparcStation II with SunOs 4.1.0:

--------------------------------------------------------------------------------

template<class Info> class A
{
  Info	    info; // if deleted, compile
};



template<class Info> class B
{
  A<Info> **foo; // if deleted, compile
};


template<class T> class C
{
public:

  inline void Frob(T& elem) {} // if deleted, compile

};


template<class T> class D: private C<T>
{
};


template<class T> class E: private C< T * >
{
public:
  inline void  Zap(T& elem) { }; // if deleted, compile
};


class F
{
public:
  ~F();// if deleted, compile
};

class G
{
public:

  D<int> zap; // if deleted, compile
  B<F> foo; // if deleted, compile
};


class H
{
public:

  E<int> frob;// if deleted, compile
};


--------------------------------------------------------------------------------


Produce the following output:

--------------------------------------------------------------------------------

cd /users3/dececco/Projects/Back/Errore/
make -k rogne
gcc-2.3.2 -v -Wall -g -DMAX=3  -pipe  -o rogne -c rogne.cc
Reading specs from /usr/local/lib/gcc-lib/sparc-sunos4.1/2.3.2/specs
gcc version 2.3.2
 /usr/local/lib/gcc-lib/sparc-sunos4.1/2.3.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -g -Wall -DMAX=3 rogne.cc |
 /usr/local/lib/gcc-lib/sparc-sunos4.1/2.3.2/cc1plus -quiet -dumpbase rogne.cc -g -Wall -version -o - |
 as - -o /usr/tmp/cca168181.o
GNU CPP version 2.3.2 (sparc)GNU C++ version 2.3.2
 (sparc) compiled by GNU C version 2.3.2.
rogne.cc:63: Internal compiler error.
rogne.cc:63: Please report this to `bug-g++@prep.ai.mit.edu'.
*** Error code 1
make: Warning: Target `rogne' not remade because of errors

Compilation finished at Wed Dec 16 15:44:18

--------------------------------------------------------------------------------

The name "rogne" is more orless the translation of troubbles in Italian.


Maurizio


Maurizio De Cecco

Office					Home
NSL				
57-59 rue Lhomond 75005 Paris		44 rue Servan 75011 Paris
tel +33-(1)-43367750 			tel: +33-(1)-49299507 
fax +33-(1)-43365978			fax: +33-(1)-49299507 
email: dececco@nsl.fr                   email: dececco@birillo.gna.org

==> please use office e-mail for professional use only           <==
==> please use home e-mail for personal and Alice communications <==
==>          if you are in a hurry, use office e-mail            <==

Newsgroups: gnu.g++.bug
From: steve@maths.warwick.ac.UK (Steve Rumsby)
Subject: g++ 2.3.2 bug
Organization: Maths Institute, Warwick University, Coventry, UK.
Distribution: gnu
Date: Wed, 16 Dec 1992 15:39:27 GMT

Script started on Wed Dec 16 15:32:21 1992
$ g++ -v
Reading specs from /gnu/lib/gcc-lib/sparc-sunos4/2.3.2/specs
gcc version 2.3.2
$ cat template.c
template<class T>
struct Matrix
{
	Matrix() {}
	~Matrix() {}
};

template <class T>
struct Vector: public Matrix<T>
{
	Vector(int);
};

// This is fine by cfront 3.0.1, but not by gcc 2.3.2.
// Make this inline in the class definition and it compiles OK.
// Take out the parameter and it is fine also.
template <class T>
Vector<T>::Vector(int) : Matrix<T>()
{
}

main(int argc,char *argv[])
{
	Vector<int> vertex(3);

	return 0;
}
$ g++ -c template.c
template.c: In function `int  main (int, char **)':
template.c:12: inconsistent return types for method `Vector' in class `Vector<int>'
template.c: In method `Vector<int>::~Vector ()':
template.c:18: only constructors take base initializers
template.c:20: Internal compiler error.
template.c:20: Please report this to `bug-g++@prep.ai.mit.edu'.
$ 

script done on Wed Dec 16 15:32:58 1992
--
UUCP:	 ...!uknet!warwick!steve	Internet: steve@maths.warwick.ac.uk
JANET:	 steve@uk.ac.warwick.maths	PHONE:	 +44 203 524657

Newsgroups: gnu.g++.bug
From: jason@jarthur.claremont.edu (Jason Merrill)
Subject: Inlining and templates in 2.3.2
Organization: Minimal
Distribution: gnu
Date: Thu, 17 Dec 1992 06:13:08 GMT

When compiling a program with -O2 -Wall, I got the following message:

/usr/local/gnu/lib/gcc-lib/i386-sequent-dynix/2.3.2/g++-include/iomanip.h:
In method `void  Vector::dumpOn (class ostream&)':
/usr/local/gnu/lib/gcc-lib/i386-sequent-dynix/2.3.2/g++-include/iomanip.h:72:
warning: can't inline call to `class ostream& operator << (class ostream&,
const class smanip<int>&)' which was declared inline

Is this a bug, or just something which hasn't been implemented yet?

--
Jason Merrill					jason@jarthur.claremont.edu

Newsgroups: gnu.g++.bug
From: jbg@qualcomm.com (Jeff Gehlhaar)
Subject: G++ Problem
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 16 Dec 1992 02:19:43 GMT

This suggestion was generated using gcc version 2.3.2 and libg++ 2.3 on a
sparc machine.

// Operator << should take (const void *) instead of (void *)

// I'm trying to write some code that will print an ID for a class.  When
// compiled with debugging on, an ID is kept in the class and is the value
// used.  However, when compiled with debugging off, the it would be nice
// to be able to dummy up a half-way reasonable ID.

// The obvious candidate is to return the address of the class entity.
// But this can't be done without generating errors or warnings.  Here's
// a snippet with the three candidates for concocting an ID.

#include <iostream.h>
class Class
{
public:
        void *ID1() { return this; }
        void *ID2() const { return this; }
        const void *ID3() const { return this; }
};

// These all break down in the presence of a constant object:

void demo(const Class *one)
{
                // The first try yields an error.  This is a correct
                // diagnosis; it's really illegal.
        cout << one->ID1();
                // non-const member function `void * Class::ID1 ()'
                // called for const object at this point in file

                // So, back to the drawing board; we say it is a const
                // member function.  This complains about converting
                // the const this pointer into a non-const void* pointer.
        cout << one->ID2();
                // In method `void * Class::ID2 ()const ':
                // return of non-`const *' pointer from `const *'

                // Well, that's reasonable; we should make the result a
                // const void* pointer.  Unfortunately, this gets a
                // warning because ostream& operator<< takes a (void *)
                // instead of a (const void *).
        cout << one->ID3();
                // argument passing of non-`const *' pointer from `const *'
}

// The easiest fix would be to change the library to take a (const void *)
// and depend upon the trivial promotion to match it---note that the other
// similar functions that take a pointer take a const pointer.

// The alternative would be to change the compiler to not generate a
// diagnostic when a non-const pointer is cast to void*.

// I can't find anything in the ARM or either of the two reference books
// I have that suggests which is appropriate.  For the time being, I'm
// using ID3 and providing my own operator<< that takes a (const void *).
// It works, but it's a hack, and I'm not fond of it....

// -- Greg



Newsgroups: gnu.g++.bug
From: kilitzir@csd.uch.gr (Kilitzirakis christos 122)
Subject: gcc  error (?)  with templates.
Summary: gcc reports an error in a compile-free(?) source
Keywords: gcc,error,templates
Organization: Computer Science Department, University of Crete HELLAS
Distribution: gnu
Date: Wed, 16 Dec 1992 18:05:55 GMT

 WARNING:
 THIS IS MY FIRST REPORT, SO BE PATIENT.
 --------------------------------
 VERSION :
 C18 % gcc -v
 ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
 Reading specs from /usr/local/lib/gnu/gcc-lib/sparc-sun-sunos4.1.2/2.3.1/specs
 gcc version 2.3.1
  /usr/local/lib/gnu/gcc-lib/sparc-sun-sunos4.1.2/2.3.1/ld -e start -dc -dp /lib/crt0.o -L/usr/local/lib/gnu/gcc-lib/sparc-sun-sunos4.1.2/2.3.1 -L/usr/local/lib/gnu -lm -lg++ -lgcc -lc -lgcc
  ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
  ld: Undefined symbol 
     _main 
     collect: /usr/bin/ld returned 2 exit status
--------------------------------------
DESCRIPTION OF ERROR :

listing : 
  template <class T>
   void At(T r,T &ret) {
   if (r.size != ret.size)
           cout <<" A-1 wrong args";
  T temp(r.size);
 for (int i=0;i<r.size;i++)
        temp.p[i] = r.p[i];
 for (i=1;i<r.size;i++)
        ret.p[i] = ret.p[r.size-i];
 }
............
class cm {
double *p,int size;
.........
};
cm & cm::operator/=(cm &r) {
At(*this,r);
 return *this;
}
...............................
class bcm {
cm *p;
int size;
........
};
bcm& bcm::operator/=(bcm &r) {
  At(*this,r);
return *this;
 }
compiling output ::
20 % g circle
ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
as: "/usr/tmp/cca25410.s", line 2023: error: redefinition of symbol "_At"

----------------------------------------
COMMENTS:
1.All operators needed by template function, are either defined, or 
or the objects are type double.
2.If I comment either of two calls , the compiler does not errors.
----------------------------------------
You can reach me, at 
kilitzir@ics.forth.gr
before Friday , for any questions or answers !


Happy Xmas


XXRistos






Newsgroups: gnu.g++.bug
From: oliver@ira.UKa.DE (Oliver Deussen)
Subject: bug in g++ 2.3.2
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 17 Dec 1992 14:51:51 GMT

Hallo,

I'm not an expert in c++, but g++ 2.3.2 gives me an

`gcc: Internal compiler error: program cc1plus got fatal signal 4'

with the following lines:

/////////////////////////////////////////////////////////////////////////////

class vector
{
  public:
        vector();
        vector(double, double);
        vector(const vector&);
};

class point
{
  public:
        point();
        point(double, double);
        operator vector();
};

vector  transform ( vector& );
// if you replace it by: vector  transform ( vector );
// g++ prints the correct error message


void    draw      ( point );

class Object
{
  public:
        void xyz () { draw(transform(point(0.0,0.0))); }
};

/////////////////////////////////////////////////////////////////////////////

g++ -v -ggdb -I. -I/tools/leda/incl/ -c test.c
Reading specs from /tools/gcc/gcc-2.3.2/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/specs
gcc version 2.3.2
 /tools/gcc/gcc-2.3.2/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/cpp -lang-c++ -v -I. -I/tools/leda/incl/ -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -ggdb test.c /usr/tmp/cca07603.i
GNU CPP version 2.3.2 (sparc)
 /tools/gcc/gcc-2.3.2/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/cc1plus /usr/tmp/cca07603.i -quiet -dumpbase test.cc -ggdb -version -o /usr/tmp/cca07603.s
GNU C++ version 2.3.2 (sparc) compiled by GNU C version 2.3.2.
/tools/bin/gcc: Internal compiler error: program cc1plus got fatal signal 4
*** Error code 1
make: Fatal error: Command failed for target `test.o'
 
//////////////////////////////////////////////////////////////////////////////

Hardware: SUN sparc 2 / SUN sparc 10
System: SUN OS 4.1.3

//////////////////////////////////////////////////////////////////////////////



   Oliver


Newsgroups: gnu.g++.bug
From: kilitzir@csd.uch.gr (Kilitzirakis christos 122)
Subject: gcc  error (?)  with templates.
Summary: gcc reports an error in a compile-free(?) source
Keywords: gcc,error,templates
Organization: Computer Science Department, University of Crete HELLAS
Distribution: gnu
Date: Mon, 14 Dec 1992 09:22:53 GMT

 WARNING:
 THIS IS MY FIRST REPORT, SO BE PATIENT.
 --------------------------------
 VERSION :
 C18 % gcc -v
 ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
 Reading specs from /usr/local/lib/gnu/gcc-lib/sparc-sun-sunos4.1.2/2.3.1/specs
 gcc version 2.3.1
  /usr/local/lib/gnu/gcc-lib/sparc-sun-sunos4.1.2/2.3.1/ld -e start -dc -dp /lib/crt0.o -L/usr/local/lib/gnu/gcc-lib/sparc-sun-sunos4.1.2/2.3.1 -L/usr/local/lib/gnu -lm -lg++ -lgcc -lc -lgcc
  ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
  ld: Undefined symbol 
     _main 
     collect: /usr/bin/ld returned 2 exit status
--------------------------------------
DESCRIPTION OF ERROR :

listing : 
  template <class T>
   void At(T r,T &ret) {
   if (r.size != ret.size)
           cout <<" A-1 wrong args";
  T temp(r.size);
 for (int i=0;i<r.size;i++)
        temp.p[i] = r.p[i];
 for (i=1;i<r.size;i++)
        ret.p[i] = ret.p[r.size-i];
 }
............
class cm {
double *p,int size;
.........
};
cm & cm::operator/=(cm &r) {
At(*this,r);
 return *this;
}
...............................
class bcm {
cm *p;
int size;
........
};
bcm& bcm::operator/=(bcm &r) {
  At(*this,r);
return *this;
 }
compiling output ::
20 % g circle
ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
as: "/usr/tmp/cca25410.s", line 2023: error: redefinition of symbol "_At"

----------------------------------------
COMMENTS:
1.All operators needed by template function, are either defined, or 
or the objects are type double.
2.If I comment either of two calls , the compiler does not errors.
----------------------------------------
You can reach me, at 
kilitzir@ics.forth.gr
before Friday , for any questions or answers !


Happy Xmas


XXRistos





Newsgroups: gnu.g++.bug
From: Peter.Schauer@regent.e-technik.tu-muenchen.dbp.DE (Peter Schauer)
Subject: gdb problem with gcc-2.x debug output for anon structures
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 16 Dec 1992 13:51:52 GMT

Given this little C++ program compiled by gcc-2.x (any dbx debugging version):

pes$ cat x.C
typedef struct
{
        int a;
        int b;
} my_struct;

my_struct g;
main() {}

gdb-4.x is unable to print g:

(gdb) p g
$1 = <unknown struct>
(gdb) ptype g
type = struct my_struct {<incomplete type>
}

This is due to the following #if 0 in dbxout.c:
#if 0 /* Tiemann says this creates output tha "confuses GDB".
         Too bad the info is so vague.  Hope this doesn't lose.  */
             && ! (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
                   && DECL_IGNORED_P (TYPE_NAME (type)))
#endif

If this is changed to a #if 1, gdb is able to print g:

(gdb) p g
$1 = {
  a = 0x0, 
  b = 0x0
}
(gdb) ptype g
type = struct my_struct {
    int a;
    int b;
}

I am not sure what input "confused" gdb and if the newer versions of
gdb will still get confused with that input, but maybe this if 0 should
be removed.

Hope this helps,

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de

Newsgroups: gnu.g++.bug
From: girod@tele.nokia.fi (Marc Girod)
Subject: Re: Pure virtual destructors!
Reply-To: marc.girod@ntc.nokia.com
Organization: kpd
Distribution: gnu
Date: Wed, 16 Dec 1992 09:05:16 GMT

Hi!

Abstract: To me everything was fine, but the fact that the programme
          was linked?!

Detailed:

>>>>> On Mon, 14 Dec 1992 18:39:29 GMT, tlukka@vinkku.hut.fi said:

tlukka> Pure virtual destructors dump core on HP-PA1.1 HP-UX 8.07
tlukka> Running the sample code won't succeed.

And this is ok. There was a bug in the former version of g++, making
this work!
Declaring a virtual member function pure is only a declaration, not a
definition.
It does not prevent you from defining it in addition (which was
forbidden by g++ v 2.3.1!).

In the case of a destructor, you actually must do it, because the
destructor for the base class WILL be called by the destructor for the
derived one!

tlukka> Compiles ok, though.

But to me, it shouldn't link! There is a missing definition for
B::~B(), once you explicitly declared it, no?

In any case, your keyword 'virtual' in ~B() declaration is redundant.

tlukka> ------ clip clip ---- sample code


tlukka> class A
tlukka> {
tlukka> 	int a;
tlukka> public:	
tlukka> 	A() {}
tlukka> 	virtual ~A()=0;
tlukka> };

tlukka> class B:public A
tlukka> {
tlukka> 	int b;
tlukka> public:
tlukka> 	B() {}
tlukka> 	virtual ~B()
tlukka> 	{
tlukka> 	}
tlukka> };


tlukka> int main()
tlukka> {
tlukka> 	B a;
tlukka> }

tlukka> ---------------------

Best Regards!

+-----------------------------------------------------------------------------+
| Marc Girod - Nokia Telecommunications       Phone: +358-0-511 7703          |
| TL4E - P.O. Box 12                            Fax: +358-0-511 7432          |
| SF-02611 Espoo 61 - Finland              Internet: marc.girod@ntc.nokia.com |
|    X.400: C=FI, A=Elisa, P=Nokia Telecom, UNIT=TRS, SUR=Girod, GIV=Marc     |
+-----------------------------------------------------------------------------+
--
+-----------------------------------------------------------------------------+
| Marc Girod - Nokia Telecommunications       Phone: +358-0-511 7703          |
| TL4E - P.O. Box 12                            Fax: +358-0-511 7432          |
| SF-02611 Espoo 61 - Finland              Internet: marc.girod@ntc.nokia.com |
|    X.400: C=FI, A=Elisa, P=Nokia Telecom, UNIT=TRS, SUR=Girod, GIV=Marc     |
+-----------------------------------------------------------------------------+

Newsgroups: gnu.g++.bug
From: henryc@ic.berkeley.edu
Subject: Bug Report
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 11 Dec 1992 02:58:33 GMT

As requested by your compiler, g++ (v. 2.3.2), I am mailing you this bug 
report...

Source Code:
******************************************************* bug8.C ***************
/*
 * 921210:
 * This file contains the basic requirement for this bug to show.
 *
 * Fails to compile under gnu-cygnus-13/g++
 *   Gives:
 *      /projects/gnu-cygnus/gnu-cygnus-13/devo/gcc/cp-decl.c:9986: 
 *           failed assertion
 *      /projects/gnu-cygnus/gnu-cygnus-13/mips/bin/gcc: 
 *           Internal compiler error: program cc1plus got fatal signal 4
 *
 * Fails to compile under gnu 2.3.2/g++
 *   Gives:
 *      bug8.C: In method `B<int>::~B ()':
 *      bug8.C:20: Internal compiler error 162.
 *      bug8.C:20: Please report this to `bug-g++@prep.ai.mit.edu'.
 *
 * Compiles under cxx.
 */

template<class X> class A {
public:
   virtual ~A() { }       // Removing "virtual" fixes it, 
};

template <class X> class B {
   A<X> a_;
   void c ();
                          // AND/OR adding member function, ~B() { } fixes it.
};

void B<double>::c () { }
void B<int>::c () { }

main () { }
******************************************************************************

Compilation:
******************************************************************************
% g++ bug8.C
bug8.C: In method `B<int>::~B ()':
bug8.C:30: Internal compiler error 162.
bug8.C:30: Please report this to `bug-g++@prep.ai.mit.edu'.
******************************************************************************

-Henry Chang

-- 
Henry Chang				           henryc@ic.Berkeley.EDU
UC Berkeley Graduate Student                                 Berkeley, CA

Newsgroups: gnu.g++.bug
From: Jarkko.Sonninen@lut.fi (Jarkko Sonninen)
Subject: templates
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 16 Dec 1992 21:56:50 GMT

compiling the following program causes error with assemler.
uname says system is SunOS hilja.it. 4.1.3 1 sun4c
I don't know templates or sparc assembly, but it seems to me that
g++ creates same name for all calls of template function.

	Jarkko Sonninen

---

#include <iostream.h>

template <class t> 
t max (t a, t b) (!
    return (a > b ? a : b);
!)

void main() (!
    cout << max (1, 2);
    cout << max ('a', 'b');
!)

---

<hilja:222:~>g++ -v a.C
Reading specs from /net/aapo/scratch/kasper/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/specs
gcc version 2.3.2
 /net/aapo/scratch/kasper/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/cpp -lang-c++ -v -I/net/aapo/scratch/kasper/lib/gcc-lib/include -I/net/aapo/scratch/kasper/lib/gcc-lib/g++-include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix a.C /usr/tmp/cca18655.i
GNU CPP version 2.3.2 (sparc)
 /net/aapo/scratch/kasper/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/cc1plus /usr/tmp/cca18655.i -quiet -dumpbase a.cc -version -o /usr/tmp/cca18655.s
GNU C++ version 2.3.2 (sparc) compiled by GNU C version 2.3.2.
a.C:8: warning: return type for `main' changed to integer type
 as -o /usr/tmp/cca186551.o /usr/tmp/cca18655.s
as: "/usr/tmp/cca18655.s", line 69: error: redefinition of symbol "_max"
/net/aapo/scratch/kasper/bin/gcc-sparc-sun-sunos4.1: /usr/tmp/cca186551.o: No such file or directory

---

gcc2_compiled.:
.text
	.align 4
	.global _main
	.proc	04
_main:
	!#PROLOGUE# 0
	save %sp,-136,%sp
	!#PROLOGUE# 1
	call ___main,0
	nop
	mov 1,%o0
	mov 2,%o1
	call _max,0
	nop
	mov %o0,%o1
	sethi %hi(_cout),%o2
	or %o2,%lo(_cout),%o0
	call ___ls__7ostreami,0
	nop
	mov 97,%o0
	mov 98,%o1
	call _max,0
	nop
	sll %o0,24,%o2
	sra %o2,24,%o1
	sethi %hi(_cout),%o2
	or %o2,%lo(_cout),%o0
	call ___ls__7ostreamc,0
	nop
	mov 0,%i0
	b L230
	nop
	b L230
	nop
L230:
	ret
	restore
	.align 4
	.proc	04
_max:
	!#PROLOGUE# 0
	save %sp,-112,%sp
	!#PROLOGUE# 1
	stb %i0,<(%fp+71)>
	stb %i1,<(%fp+75)>
	ldub <(%fp+71)>,%o0
	sll %o0,24,%o2
	sra %o2,24,%o1
	ldub <(%fp+75)>,%o2
	sll %o2,24,%o3
	sra %o3,24,%o2
	cmp %o1,%o2
	bge L232
	nop
	ldub <(%fp+75)>,%o0
L232:
	sll %o0,24,%o0
	sra %o0,24,%i0
	b L231
	nop
	b L231
	nop
L231:
	ret
	restore
	.align 4
	.proc	04
_max:
	!#PROLOGUE# 0
	save %sp,-112,%sp
	!#PROLOGUE# 1
	st %i0,<(%fp+68)>
	st %i1,<(%fp+72)>
	ld <(%fp+68)>,%o0
	ld <(%fp+72)>,%o1
	cmp %o0,%o1
	bge L234
	nop
	ld <(%fp+72)>,%o0
L234:
	mov %o0,%i0
	b L233
	nop
	b L233
	nop
L233:
	ret
	restore

Newsgroups: gnu.g++.bug
From: keister@poincare.phys.cmu.edu (Bradley D. Keister)
Subject: friend inline functions in 2.3.2
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 15 Dec 1992 09:29:43 GMT

I'm getting the following error messages at link time which involve an
inline friend function under g++ 2.3.2 on a SPARC and an HP:

2.3.2 on a SPARC:

% g++ -o friend friend.c
ld: Undefined symbol
   _get_a__FR1A
collect: /usr/bin/ld returned 2 exit status

2.3.2 on an HP 730:

g++ -o friend friend.c
ld: Unsatisfied symbols:
   get_a__FR1A (code)
collect: /bin/ld returned 1 exit status

// --------------------------

This code runs fine on a DECstation or SPARC running g++ 2.2.2 or a
DECstation running cfront 3.0.

Brad Keister
Department of Physics
Carnegie Mellon University
Pittsburgh, PA 15213
(412) 268-2772 (office)
(412) 681-0648 (FAX)

internet:	keister@poincare.phys.cmu.edu
BITNET:		keister%poincare.phys.cmu.edu@CARNEGIE

// --------------------------

// file "friend.h"
#ifndef FRIENDH
#define FRIENDH

class A {

 protected:
  int a;

 public:
  A(int aa) {a = aa;}
  ~A() {}

  friend int get_a(A& x) {return x.a;}
};

#endif

// --------------------------

// file "friend.c"
#include <stdio.h>

#include "friend.h"

main()
{
  A Atest(5);

  printf("a: %3d\n", get_a(Atest));

  return 0;
}

// --------------------------


Newsgroups: gnu.g++.bug