internal bug by virtual base class composition

Rostislav Chudoba
Tue Apr 21 05:15:00 GMT 1998

Here is snapshot of a code producing an internal compiler error

--------------- begin bugx.C

class OIFHeader
  virtual void create_instance();
template< class T >
class OIF
  : public OIFHeader
  class inst_tp: public T
  void create_instance(){ 
    inst_tp d;       // internal compiler error is reported here

class FirstIfc

class FirstImpl1
  : public virtual FirstIfc

OIF<FirstImpl1> d;

-------------------- end bugx.C

The bug is reported when creating an instance of the embedded class inst_tp;
If any of the two `virtual' keywords is removed the code compiles. On
the other hand, if T is inherited as a virtual base class the
compilation gets through too. 

Version info:
Reading specs from /user/rch/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release) 

(This code compiles with gcc version


More information about the Gcc-bugs mailing list