Internal compiler error

Michael Ward mward@are.Berkeley.EDU
Wed Oct 29 22:16:00 GMT 1997


egcs requested a bug report.  The code it puked on is probably illegal in
C++ -- I'm just learning.


session script:
-------------------
> egcs_g++ matrix.cc
matrix.cc: In method double & matrix::operator ()(unsigned int, unsigned int)':
matrix.cc:38: Internal compiler error.
matrix.cc:38: Please submit a full bug report to egcs-bugs@cygnus.com'. 
-------------------
snapshot 971023 (clean source)
Solaris 2.5 (hypersparc)
the offending code fragment:

typedef unsigned uint;
class matrix : public vector<double> 
{
...
 reference (matrix::*ref) (uint, uint);
public:
...
 iterator next(void)  {return next_++;}
 reference sc (uint i, uint j) {return *begin();}
 reference rv (uint i, uint j) {return (*this)[j];}
 reference cv (uint i, uint j) {return (*this)[i];}
 reference mx (uint i, uint j) {return *next();}
 reference operator() (uint i, uint j) {return this->ref(i,j);} // *** Line 38 ***
};

void matrix::resize (uint a, uint b) 
{
...
 switch(type_)
 { 
  case Matrix:   ref = &mx; return;
  case Scalar:   ref = ≻ return;
  case Row_vec:  ref = &rv; return;
  case Col_vec:  ref = ≻ return;
 }
}					      }



More information about the Gcc-bugs mailing list