Internal compiler error using g++-2.91.33

Bernd Nottelmann nottelm@ptp283.uni-muenster.de
Fri May 29 03:23:00 GMT 1998


Hi,

I have reported this bug two weeks ago, but noone
answered. So I decided to send you the bug report
again ...
Here is a testcase:

/*---------------------------snip---------------------------*/
template < class T > class A
{
public:
  typedef typename T::myT anotherT;

  anotherT t;

  A(anotherT _t) {
    t=_t;
  }

  anotherT getT() {
    return t;
  }
};

class B : public A< B >
{
public:
  typedef int myT;
};

int main() {
  B b;
}
/*---------------------------snip---------------------------*/

class B inherits template class A and delivers itself
as template parameter to its parent class. Within B the
type int is redefined as myT and should either
be recognized by A or the compiler should produce
an error message, that class type A is incomplete.
Instead of this g++ produces the following output:

> g++ tttst.C
tttst.C: In instantiation of `A<B>':
tttst.C:19:   instantiated from here
tttst.C:19: Internal compiler error.
tttst.C:19: Please submit a full bug report to `egcs-bugs@cygnus.com'.

Compiler version:

> g++ -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.33/specs
gcc version egcs-2.91.33 19980525 (gcc2 ss-980502 experimental)

Bernd



More information about the Gcc-bugs mailing list