Internal compiler error with egcs-1.0.3

Matti Rintala bitti@dcs.kcl.ac.uk
Tue Jul 7 05:21:00 GMT 1998


Hi!

The following code produces an internal compiler error with egcs-1.0.3
release (I haven't tried it with anything newer). It seems that egcs
has problems with template classes derived from classes with virtual
base classes. I'm running Redhat 5.1 Linux (although I guess this bug
is probably not platform dependent).

------------- foobar.cc ----------------
class B
{
public:
  B(int) {}
};

class C1 : public virtual B
{
public:
  C1(float) : B(1) {}
};

template<typename T>
class C2 : public T
{
public:
  C2() : B(2), T(3.2) {}
};

void foo()
{
  C2<C1> c;
}
------------- foobar.cc ----------------

[pc187 fprox]$ eg++ -W -Wall -pedantic -c foobar.cc
foobar.cc:22: Internal compiler error.
foobar.cc:22: Please submit a full bug report to `egcs-bugs@cygnus.com'.
[pc187 fprox]$ eg++ -v
Reading specs from /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)


				Matti Rintala
				bitti@cs.tut.fi



More information about the Gcc-bugs mailing list