This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error


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 = &sc; return;
  case Row_vec:  ref = &rv; return;
  case Col_vec:  ref = &sc; return;
 }
}					      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]