Internal compiler error 97 - continued

Jakub Moscicki Jakub.Moscicki@cern.ch
Wed Apr 26 07:55:00 GMT 2000


The error disappears when I correctly use typenames in the
pointer-to-function typedef. The previous example should generate compile
errors but not internal error!

cheers,

kuba 

-----

template<int N, int M>
class RealFunction : public Function< RealSpace<N>, RealSpace<M> >
{
public:

  typedef RealFunction<N,M> thisfunction;

  typedef Function::xspace xspace;
  typedef Function::yspace yspace;

  // funptr is a pointer to global function
  // internal compiler error with egcs 1.1.2 !
  
  // ***************************************************
  // >>>>>>>>> I MODIFIED THE LINE BELOW <<<<<<<<<<<<<<<
  // ***************************************************

  typedef typename yspace::datapoint (*funptr)(typename xspace::datapoint
x);

  //  RealFunction( typename yspace::datapoint (*funptr)(xspace::datapoint
x) ) : fp(funptr) {}
  RealFunction( funptr _fp ) : fp(_fp) {}
  
  virtual typename yspace::datapoint operator()(typename xspace::datapoint
x) const
  {
    return (*fp)(x);
  }

  virtual void print(ostream & os) const
  {
    os << "RealFunction: " << N << "->" << M << " with a funptr = " << fp
<< endl;
  }

private:

  funptr fp;
  
};


-------------------------------------------------------------
      mow mi KUBA     call me KUBA     appelle-moi KUBA
-------------------------------------------------------------




More information about the Gcc-bugs mailing list