This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs internal comp. error
- To: egcs-bugs at cygnus dot com
- Subject: egcs internal comp. error
- From: acorbi at pentium1 dot dlsi dot ua dot es (Antonio M. Corbi Bellot)
- Date: Mon, 18 May 1998 07:39:57 +0200 (CEST)
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.