HDTenEightyP/NetNews huggingface dataset:
From: turlais@rechser.total.fr (Rech TURLAIS Tel 4216 15-01-92 MJ )
Subject: Bug on SUN4 with -O option
Reply-To: turlais@rechser.total.fr
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 14 Aug 1992 14:30:39 GMT

   The following program has a SEGV when compiled with -O option on SUN4C
  ( SunOs 4.1.1 ).
   
   The involved part of the code is :

    fwd_symb *b = bindings;  // bindings is a member of a class and is set to 0

    // When -O is on, a SEGV occurs here.

    while( b && b->fun == 0 )
	b = b->next;

   The whole ( but small program ) is below.

   Thank you.

   P. Turlais

  The compile command is :

gcc -v -O tt.cc
Reading specs from /d/turlais/lib/gcc-lib/sun4/2.2.2/specs
gcc version 2.2.2
 /d/turlais/lib/gcc-lib/sun4/2.2.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 -D__OPTIMIZE__ tt.cc /usr/tmp/cca16655.i
GNU CPP version 2.2.2 (sparc)
 /d/turlais/lib/gcc-lib/sun4/2.2.2/cc1plus /usr/tmp/cca16655.i -quiet -dumpbase tt.cc -O -version -o /usr/tmp/cca16655.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
 as -o tt.o /usr/tmp/cca16655.s
 /d/turlais/lib/gcc-lib/sun4/2.2.2/ld -e start -dc -dp /lib/crt0.o -L/d/turlais/lib/gcc-lib/sun4/2.2.2 -L/d/turlais/lib tt.o -lgcc -lc -lgcc
52 halley % 

-------------   Program    -------------------------------------

class symb;

class fwd_symb {
    public:
    fwd_symb *next;
    symb *fun;
    int i;
};

class symb {
public:

    symb *get_fwd_symb();
    char *name;
    fwd_symb *bindings;
    symb *fun;
    int i;
};

symb *symb::get_fwd_symb()
{
    fwd_symb *b = bindings;

    // When -O is on, a SEGV occurs here.

    while( b && b->fun == 0 )
	b = b->next;
    
    if( b)
	return fun ? fun->get_fwd_symb() : 0;
    else
	return b->fun ? b->fun->get_fwd_symb() : 0;
}

int main() {
    
    symb es;

    es.bindings = 0;

    symb *f = es.get_fwd_symb();
}

Newsgroups: gnu.g++.bug
From: tmb@idiap.CH (Thomas M. Breuel)
Subject: uninitialized static members
Reply-To: tmb@idiap.ch
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 16 Aug 1992 21:04:40 GMT

I'm having a problem with uninitialized static class members in GCC
C++ 2.2.2.

Basically, if I only define the static class member inside the class
(without explicitly initializing it), I get a link-time undefined
symbol error.

I was under the impression that I didn't have to provide any
definition (in addition to what is present in the header) for
uninitialized static class members.

				Thomas.

PS: A little more concretely:

struct NISTDigitImages {
	static int *table;
	...
};

 ...

gcc -L/homes/tmb/src/nvis/lib  rec-gh.o loadihdr.o ihead.o g4decomp.o winlib.o -lX11 -lvis -lm   -o rec-gh
ld: Undefined symbol 
   __15NISTDigitImages$table 
collect: /usr/bin/ld returned 2 exit status
make: *** [rec-gh] Error 1

Newsgroups: gnu.g++.bug
From: mccanne@horse.ee.lbl.gov (Steven McCanne)
Subject: cc1plus bug: friends that are destructors
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 20 Aug 1992 00:13:54 GMT

cc1plus does not allow destructors to be declared as friends.
It reports an error for the following code fragment:

1	class B {
2	public:
3		~B();
4	};
5
6	class A {
7		friend B::~B();
8	};

The error is

t.cc:7: class `B' already has destructor defined

The problem is a gratuitous check in grokdeclarator(), in cp-decl.c.
Removing the offending check solves the problem.  (A multiply-declared
destructor is detected elsewhere.)

Steve
-----
*** /tmp/,RCSt1a29274	Wed Aug 19 17:00:59 1992
--- cp-decl.c	Wed Aug 19 15:56:42 1992
***************
*** 7167,7174 ****
  			if (! member_function_or_else (ctype, current_class_type,
  						       "destructor for alien class `%s' cannot be a member"))
  			  return NULL_TREE;
- 			if (TYPE_HAS_DESTRUCTOR (ctype))
- 			  error_with_aggr_type (ctype, "class `%s' already has destructor defined");
  		      }
  		  }
  		else if (flags == WRAPPER_FLAG || flags == ANTI_WRAPPER_FLAG)
--- 7167,7172 ----

Newsgroups: gnu.g++.bug
From: jody@shell.COM (Jody Winston)
Subject: Re:  g++ Version 2.2.2 core dump in cc1plus
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 18 Aug 1992 22:11:40 GMT

Also in cp-class.c near line 726:

      modify_vtable_entry (get_vtable_entry (BINFO_VIRTUALS (binfo), base_fndecl),
			   build_vtable_entry (this_offset, pfn),
			   fndecl, base_context);

BINFO_VIRTUALS (binfo) can be NULL.

Jody

Newsgroups: gnu.g++.bug
From: bilmes@media.mit.edu
Subject: gcc (g++) 2.2.2 cc1plus fatal sig 4, access static member obj for arr init.
Reply-To: Jeff Bilmes <bilmes@media-lab.media.mit.edu> (617/253-8163)
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 20 Aug 1992 19:20:20 GMT

----------------------------- a.h ----------------------------------------
class foo {
  int i;
 public:
  foo(int j) { i = j; }
  static foo f;
};
--------------------------------------------------------------------------


---------------------------- a.cc ----------------------------------------
#include "a.h"

foo farray[] = {
  foo(1),
  foo(2),
  foo::f
};
--------------------------------------------------------------------------


Reading specs from /usr/local/lib/gcc-lib/mips-dec-ultrix4.2/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/mips-dec-ultrix4.2/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__ANSI_COMPAT -DMIPSEL -DR3000 -DSYSTYPE_BSD -D_SYSTYPE_BSD -Dbsd4_2 -Dhost_mips -Dmips -Dultrix -Dunix -D__ANSI_COMPAT -D__MIPSEL__ -D__R3000__ -D__SYSTYPE_BSD__ -D___SYSTYPE_BSD__ -D__bsd4_2__ -D__host_mips__ -D__mips__ -D__ultrix__ -D__unix__ -D__ANSI_COMPAT -D__MIPSEL -D__R3000 -D__SYSTYPE_BSD -D___SYSTYPE_BSD -D__bsd4_2 -D__host_mips -D__mips -D__ultrix -D__unix -I/usr/local/lib/gcc-lib/m

ips-dec-ultrix4.2/2.2.2/lib/g++-include -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C a.cc /usr/tmp/cca07416.i
GNU CPP version 2.2.2 [AL 1.1, MM 19] DECstation running ultrix
 /usr/local/lib/gcc-lib/mips-dec-ultrix4.2/2.2.2/cc1plus /usr/tmp/cca07416.i -quiet -dumpbase a.cc -version -o /usr/tmp/cca07416.s
GNU C++ version 2.2.2 [AL 1.1, MM 19] DECstation running ultrix compiled by GNU C version 2.2.2.
gcc: Internal compiler error: program cc1plus got fatal signal 4


Note: Adding copy constructor to class foo fixes the prob.

------------------------------------------------------------
class foo {
  int i;
 public:
  foo(int j) { i = j; }
  foo(foo& f) { i = f.i; }
  static foo f;
};
------------------------------------------------------------


Newsgroups: gnu.g++.bug
From: skohn@cs.ucsd.edu (Scott Kohn)
Subject: g++ crashes when compiling destructor of nested class
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 19 Aug 1992 20:56:51 GMT

There is a bug in gcc-2.2.2 which causes cc1plus to dump core when
compiling the destructor of a nested class:

------------------------------ crash.c ------------------------------  
class X
  {
   class Y
     {
   public:
      Y();
      ~Y();
     };
public:
   X();
   ~X();
  };

X::Y::Y() { }           // this is ok
X::Y::~Y() { }          // this is not
---------------------------------------------------------------------

picard [380]% g++ -v -c crash.c
Reading specs from /cse/grad/skohn/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/specs
gcc version 2.2.2
 /cse/grad/skohn/lib/gcc-lib/sparc-sun-sunos4.1/2.2.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 crash.c /usr/tmp/cca08633.i
GNU CPP version 2.2.2 (sparc)
 /cse/grad/skohn/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cc1plus /usr/tmp/cca08633.i -quiet -dumpbase crash.cc -version -o /usr/tmp/cca08633.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
/cse/grad/skohn/bin/gcc: Internal compiler error: program cc1plus got fatal signal 11

picard [381]% gdb /cse/grad/skohn/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cc1plus
(gdb) core-file core
Core was generated by `cc1plus'.
Program terminated with signal 11, Segmentation fault.
#0  build_overload_name (parmtypes=0x0, begin=1, end=1) at cp-method.c:1572
1572      if (just_one = (TREE_CODE (parmtypes) != TREE_LIST))
(gdb) where
#0  build_overload_name (parmtypes=0x0, begin=1, end=1) at cp-method.c:1572
#1  0x27598 in grokclassfn (ctype=0x186418, cname=0x1863b8, function=0x18e008, 
    flags=DTOR_FLAG, quals=0x17f7a8) at cp-decl2.c:627
#2  0x1cf2c in grokfndecl (ctype=0x186418, type=0x186888, declarator=0x1863b8, virtualp=0, 
    flags=DTOR_FLAG, quals=0x0, raises=0x0, check=1) at cp-decl.c:5954
#3  0x219ac in grokdeclarator (declarator=0x1863b8, declspecs=0x0, decl_context=NORMAL, 
    initialized=1, raises=0x0) at cp-decl.c:7987
#4  0x23a5c in start_function (declspecs=0x0, declarator=0x174e48, raises=0x0, pre_parsed_p=0)
    at cp-decl.c:9239
#5  0xe628 in yyparse () at cp-parse.y:635
#6  0x7aca8 in compile_file (name=0xf7fffa99 "/usr/tmp/cca08633.i") at toplev.c:1638
#7  0x7d88c in main (argc=8, argv=0xf7fff9d4, envp=0xf7fff9f8) at toplev.c:3055

Note that it is ok to define the destructor of the nested class in the declaration.
Thus, you can get around this bug using the following (yuck):

------------------------------ ugly.c ------------------------------  
class X
  {
   class Y
     {
      void destructor_hack();
   public:
      Y();
      inline ~Y() { destructor_hack(); }
     };
public:
   X();
   ~X();
  };

X::Y::Y() { }
void X::Y::destructor_hack() { }
--------------------------------------------------------------------

Newsgroups: gnu.g++.bug
From: wjasper@unity.ncsu.EDU (Warren Jasper)
Subject: What do these warnings mean ??
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 14 Aug 1992 07:51:51 GMT

{70} make mtest
g++ -c -Wall -DDOUBLE -g -O   utilities.c  -o utilities.o
utilities.c: In method `class Vector& Vector::sort ()':
utilities.c:644: warning: contravariance violation for method types ignored
utilities.c: In method `class ComplexVector& ComplexVector::sort ()':
utilities.c:737: warning: contravariance violation for method types ignored
utilities.c: In method `class Matrix& Matrix::sort ()':
utilities.c:745: warning: contravariance violation for method types ignored
utilities.c: In function `double  cond (class Matrix&)':
utilities.c:767: warning: contravariance violation for method types ignored

Could someone tell me what a contravariance violation is?  We have just
upgraded our version of g++ from 1.39.0 to version 2.2.2.


Thanks,


	-- Warren

Warren J. Jasper
wjj@nelson.tx.ncsu.edu

Newsgroups: gnu.g++.bug
From: steve@maths.warwick.ac.UK (Steve Rumsby)
Subject: g++ 2.2.2 bug with extern "C" friends
Organization: Maths Institute, Warwick University, Coventry, UK.
Distribution: gnu
Date: Tue, 11 Aug 1992 16:57:51 GMT

Classes with extern "C" friend functions seem to give cc1plus gastric distress.
This happens on Sparc (SunOS 4.1.1), Sun 3 (SunOS 4.1.1), and SGI MIPS
(Irix 4.0.1) boxes, so I guess it is pretty fundamental! Any suggestions?

Thanks,
Steve.

$ cat kb.c
extern "C" int bar();

struct foo {
	friend int bar();
};
$ g++ -v kb.c
Reading specs from /gnu/lib/gcc-lib/sparc-sunos4/2.2.2/specs
gcc version 2.2.2
 /gnu/lib/gcc-lib/sparc-sunos4/2.2.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 kb.c /usr/tmp/cca00897.i
GNU CPP version 2.2.2 (sparc)
 /gnu/lib/gcc-lib/sparc-sunos4/2.2.2/cc1plus /usr/tmp/cca00897.i -quiet -dumpbase kb.cc -version -o /usr/tmp/cca00897.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
/gnu/bin/gcc: Internal compiler error: program cc1plus got fatal signal 11

--
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: tmb@idiap.CH (Thomas M. Breuel)
Subject: "unexpected argument to constructor"
Reply-To: tmb@idiap.ch
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 12 Aug 1992 00:02:14 GMT

[sorry if you are receiving this twice; Switzerland was having network
troubles]

I believe in the following code, the GNU C++ compiler incorrectly
complains about "unexpected argument to constructor `Match'"; the
default copy constructor should get generated and used by the compiler
(if "vec2" is replaced with "float", there is no complaint).

================================================================
struct vec2 {
	float x,y;
	vec2() {}
	vec2(float x,float y):x(x),y(y) {}
};

struct Match {
	vec2 t;
	vec2 r;
	float quality;
	float maxerr;
};

Match f() {
	Match x;
	return x;
}
================================================================
cd /fs/vision01/tmb/src/char/
gcc -c -g -v test.cc
Reading specs from /sym/gnu/lib/gcc-lib/sparc/2.2.2/specs
gcc version 2.2.2
 /sym/gnu/lib/gcc-lib/sparc/2.2.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 test.cc /local/tmp/cca11642.i
GNU CPP version 2.2.2 (sparc)
 /sym/gnu/lib/gcc-lib/sparc/2.2.2/cc1plus /local/tmp/cca11642.i -quiet -dumpbase test.cc -g -version -o /local/tmp/cca11642.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
test.cc: In function `struct Match f ()':
test.cc:16: unexpected argument to constructor `Match'

Compilation exited abnormally with code 1 at Sun Aug  9 16:42:03

Newsgroups: gnu.g++.bug
From: schoenfr@ibr.CS.tu-bs.DE (Erik Schoenfelder)
Subject: Linker is missing symbols, when profiling is enabled with g++
Reply-To: schoenfr@ibr.cs.tu-bs.de
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 21 Aug 1992 16:45:22 GMT

Hi!

The host is a Sparcstation 2 with SunOS 4.1.1

GCC version 2.2.2 was configured:

>	# GCC was configured as follows:
>	../gcc-2.2.2/configure sun4

and libg++ version 2.2 was configured:

>	# This directory was configured as follows:
>	./configure sun4 -norecursion 


Compiling with the -pg switch, causes the linker to report undefined
symbols.  (This does not happen, if the libg++ is compiled without the
-g flag; but the default installation is with -g).  Below an example:

>	% cat pp.cc
>	#include <fstream.h>
>	
>	main ()
>	{
>	        cout << "hi nase\n";
>	}
>	% g++ -v -pg pp.cc
>	Reading specs from /usr/local/lib/gcc-lib/sun4/2.2.2/specs
>	gcc version 2.2.2
>	 /usr/local/lib/gcc-lib/sun4/2.2.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 pp.cc
>	 /usr/tmp/cca21887.i
>	GNU CPP version 2.2.2 (sparc)
>	 /usr/local/lib/gcc-lib/sun4/2.2.2/cc1plus /usr/tmp/cca21887.i -quiet
>	 -dumpbase pp.cc -version -p -o /usr/tmp/cca21887.s
>	GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
>	 as -o pp.o /usr/tmp/cca21887.s
>	 /usr/local/lib/gcc-lib/sun4/2.2.2/ld -e start -dc -dp /lib/gcrt0.o
>	 -L/usr/local/lib/gcc-lib/sun4/2.2.2 -L/usr/local/lib pp.o -lg++ -lgcc
>	 -lc_p -lgcc
>	Undefined
>	LBE60
>	LBB60
>	LBE50
>	LBB50
>	[...]
>	LBB38
>	LBE39
>	LBB39
>	collect: /usr/bin/ld returned 2 exit status
>	% nm /usr/local/lib/libg++.a | grep LBE60
>	         U LBE60
>	%

These undefined symbols seems to be contained in the stabs of libg++.a
(compiled with default CFLAGS=-g).  It's seems to be an error in the
output of the debugging information, but i have no idea how to fix it.

Thanks, Erik.

Newsgroups: gnu.g++.bug
From: etnkna@hisoy2.etn.ericsson.SE (Aksnes Knut-Havard)
Subject: Bug with multible inheritance and virtual member functions.
Organization: Ericsson Telecom AS
Distribution: gnu
Date: Thu, 13 Aug 1992 11:18:45 GMT

The following skeleton pinpoints a bug in g++2.2.2 with the gdb-4.6
patch. I am using sparc with sunos 4.1.2. 

The TimedObject class maintains a static array of pointers to all
TimedObjects, th TicTock class sometimes calls the timeout functions
via these pointers. The problem being that the wrong timeout function
is used: The function in defined in StateMachine is called for MS
objects, this happens even when the timeout function in StateMachine
is removed then causing a branch to never-never land. The debuger
tells me that the vtable ptr is faulty.

The problem dissapears when TimedObject is made a derived class of
PrintableObject, and the multiple inheritance for StateMachine is
removed.

class TimedObject // This class maintains a static timer queue
{
	.
	.
	.
	virtual void timeout() = 0;
	.
	.
	
	void Static::TicTock();
// This function increments timer then it calls timeout for objects in
// queue with their timer expired.
};

class PrintableObject
{
	// This class exists to avoid having to define a 
	// ostream& operator<<(ostream&, const <clasname>&);
	// for all classes that can print itself out.
	
public:
	virtual void printon(ostream&) = 0;
};


class StateMachine: public PrintableObject, public TimedObject
{
public:
	.
	.
	.
	// Not necesary 
	virtual void timeout();	// added to isolate bug
	.
	.
	.
};

class MS: public StateMachine, public ...
{
	.
	.
	.
	virtual void timout();
	.
	.
	.
};


--

-------------------------------------------------------------------------------
Name:	Knut-Hevard Aksnes (ECMA 94) or		Knut-Haavard Aksnes (ASCII)
Ericsson signature: HI/ETN/U/IT KNA		Phone: +47 41 19481
Email: etnkna@etn.ericsson.se (internet)  ETN.ETNKNA (memo)


Newsgroups: gnu.g++.bug
From: ctan@solomon.technet.sg (Tan Chee Weei)
Subject: Bug Report
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 21 Aug 1992 22:41:54 GMT

GCC (G++) Bug Report

Version: gcc 2.2.2
Source file: 

// start

class X
{
public:
int i;
void f(int i) { X::i = i; }
};

// end

Problem: Compile with g++ -c <file>
         with or without -g and -O or both results in:

         bug.C: In method `void X::f (int)':
         bug.C:5: invalid lvalue in unary `&'

Hardware: Sparcstation 4/330 running SunOS 4.1.1
Configure operands: sparc-sun-sunos4.1.1
Modifications: None
libg++ version: 2.1

Observations: I am quite sure the input syntax is correct. Other C++ 
              compilers accept it without problems. Current workaround
              is to use this->i = i;





Newsgroups: gnu.g++.bug
From: keister@poincare.phys.cmu.edu (Bradley D. Keister)
Subject: pointers to member functions
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 20 Aug 1992 10:42:15 GMT

The following code fragment is taken from a larger file which compiles
and runs correctly under cfront.  Under g++ 2.2.2 compilation, I get

ptest.c:22: parse error before `)'
ptest.c:22: `generic' declared as function returning a function
ptest.c:23: parse error before `::'
ptest.c:23: parse error before `)'
ptest.c: In method `double  B::A12 (double)':
ptest.c:28: warning: implicit declaration of function `generic'

Here's the code:
---------------
// -*- C++ -*-

class A {

public:
  double F1(double x);
  double F2(double x);
  double F3(double x);
  double F4(double x);
};

class B {
  
protected:
  A* a;
  
public:
  
  B() {a = new A;}
  ~B() {delete a;}
  
  double generic(double (A::*)(double Qsq), 
		 double (A::*)(double Qsq), 
		 double x);
  
  double A12(double x)
    {
      return generic(&A::F1, &A::F2, x);
    }
  
  double A34(double x)
    {
      return generic(&A::F3, &A::F4, x);
    }
  
};

Is there a way around this?  Am I doing something wrong?

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

Newsgroups: gnu.g++.bug
From: arr@ukc.ac.UK (A.R.Runnalls)
Subject: Miscompiled vtbl
Organization: Computing Lab, University of Kent at Canterbury, UK.
Distribution: gnu
Date: Tue, 11 Aug 1992 08:58:12 GMT

The following program gives the output `I'm an LR' instead of the
correct output `I'm an LR2'.  The problem, which appears to be due to
the virtual table for LR2 being wrongly set up, disappears if either the
virtual destructor for class L is removed, or if a virtual destructor is
added to class R.

Environment: g++ 2.2.2 on Sparc running SunOS 4.

Script started on Tue Aug 11 09:49:52 1992
vtblbug% cat -n vtblbug.cc
     1	// vtblbug.cc
     2	
     3	#include <iostream.h>
     4	
     5	class L {
     6	public:
     7	    virtual ~L() {}
     8	    virtual void whatami(ostream& stream = cout) const
     9	       {stream << "I'm an L" << endl;}
    10	};
    11	
    12	class R {
    13	public:
    14	    virtual void whatami(ostream& stream = cout) const
    15	       {stream << "I'm an R" << endl;}
    16	};
    17	
    18	class LR : public L, public R {
    19	public:
    20	    void whatami(ostream& stream = cout) const
    21	       {stream << "I'm an LR" << endl;}
    22	};
    23	
    24	class LR2 : public LR {
    25	public:
    26	    void whatami(ostream& stream = cout) const
    27	       {stream << "I'm an LR2" << endl;}
    28	};
    29	
    30	main()
    31	   {LR2 node;
    32	    L *node_ptr = &node;
    33	    node_ptr->whatami();}
vtblbug% make vtblbug
rm -f vtblbug.o
g++ -c -g -v -Wall vtblbug.cc
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.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 vtblbug.cc /usr/tmp/cca19588.i
GNU CPP version 2.2.2 (sparc)
 /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cc1plus /usr/tmp/cca19588.i -quiet -dumpbase vtblbug.cc -g -Wall -version -o /usr/tmp/cca19588.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
 as -o vtblbug.o /usr/tmp/cca19588.s
g++ -g  -v -o vtblbug vtblbug.o
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/ld -e start -dc -dp -o vtblbug /lib/crt0.o -L/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2 -L/usr/local/lib vtblbug.o -lg++ -lgcc -lc -lg -lgcc
vtblbug% !$
vtblbug
I'm an LR
vtblbug% exit
vtblbug% 
script done on Tue Aug 11 09:51:26 1992

Newsgroups: gnu.g++.bug
From: solomon@cs.wisc.edu (Marvin Solomon)
Subject: bug in g++ 2.2.2
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 20 Aug 1992 07:59:37 GMT

The following program reports a syntax error.  The exmaple from which this
was distilled used <sys/stat.h> which declares both a structure and a
function named "stat".
	struct	s { int a; };
	extern int       s () ;
	int f() {
		::s();
		return 0;
	}

By the way, is any body reading these bug reports?  I've sent in several
over that last couple of week and have received not so much as an
acknowlegement.  I realize that I shouldn't expect much service for the
prices I'm paying :-), but it would be nice to at least get an ack.
Otherwise, what's the point of preparing reports?

Reading specs from /usr/gnu/lib/gcc-lib/decstation/2.2.2/specs
gcc version 2.2.2
 /usr/gnu/lib/gcc-lib/decstation/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__ANSI_COMPAT -DMIPSEL -DR3000 -DSYSTYPE_BSD -D_SYSTYPE_BSD -Dbsd4_2 -Dhost_mips -Dmips -Dultrix -Dunix -D__ANSI_COMPAT -D__MIPSEL__ -D__R3000__ -D__SYSTYPE_BSD__ -D___SYSTYPE_BSD__ -D__bsd4_2__ -D__host_mips__ -D__mips__ -D__ultrix__ -D__unix__ -D__ANSI_COMPAT -D__MIPSEL -D__R3000 -D__SYSTYPE_BSD -D___SYSTYPE_BSD -D__bsd4_2 -D__host_mips -D__mips -D__ultrix -D__unix -D__LANGUAGE_C__ -D__LANGUAGE_C -DLA
NGUAGE_C foo1.c /usr/tmp/cca06298.i
GNU CPP version 2.2.2 [AL 1.1, MM 19] DECstation running ultrix
 /usr/gnu/lib/gcc-lib/decstation/2.2.2/cc1plus /usr/tmp/cca06298.i -quiet -dumpbase foo1.cc -version -o /usr/tmp/cca06298.s
GNU C++ version 2.2.2 [AL 1.1, MM 19] DECstation running ultrix compiled by GNU C version 2.2.2.
foo1.c: In function `int  f ()':
foo1.c:4: parse error before `;'

Newsgroups: gnu.g++.bug