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]

egcs internal comp. error


Hi:

My name is Antonio Corbi, and using g++ (egcs 1.0.3 prerelease)
tried to compile the following (erroneous) code of a student:

-------------------------------------------------------------
/********** SOBRECARGA DEL OPERADOR = **********/

TVector&
TVector::operator=(TVector &vector2)
{
   if (vector != NULL)     // si existe el vector, lo destruimos
      TVector::~TVector;   // <----- ERROR

   tam = vector2.tam;               // le asignamos el nuevo tamano
   vector = new int[vector2.tam];   // y le reservamos memoria

   for (int cont = 0; cont < tam; cont++)   // copiamos el nuevo contenido
      vector[cont] = vector2.vector[cont];  // del vector

   return *this;   // devolvemos un puntero a si mismo
}
------------------------------------------------------------

As you see, after the first 'if', He tried to call the destructor of the
class TVector, but he forgot to include the '()' (and an object like 'this').

The result trying to compile it with g++ egcs 1.0.3 prerelease (from Debian 
GNU/Linux 2.0) gives this:

$ g++ -c tvector.cc
tvector.cc: In method `class TVector & TVector::operator =(class TVector &)':
tvector.cc:95: Internal compiler error 999.
tvector.cc:95: Please submit a full bug report to `egcs-bugs@cygnus.com'.


Hope this message be usefull.
A. Corbi.



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