This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Internal compiler error / missing semicolon
- To: egcs-bugs at cygnus dot com
- Subject: Internal compiler error / missing semicolon
- From: Mark Richters <mr at informatik dot uni-bremen dot de>
- Date: 12 Jun 1998 13:13:50 +0200
The following code causes an internal compiler error with the 19980608
snapshot, with egcs-1.0.3a and gcc-2.8.1. Output from the latest
snapshot is below. Obviously, there's a semicolon missing at the end
of OTUtil's class declaration. The internal error is somehow related
to the inlined static member function toString(). Changing its
definition (e.g. to return "foo" in the last line) leads to a correct
error message "semicolon missing after declaration of `class OTUtil'".
Mark
--bug2.cc-----------------
#include <string>
#include <strstream.h>
class OTLabel
{
public:
OTLabel();
};
class OTUtil {
public:
static string toString(int i) {
ostrstream s;
s << i;
return s.str();
}
}
OTLabel::OTLabel() {}
-------------------------
-> egcs-g++ -c -v bug2.cc
Reading specs from /home/dbs/lang/egcs-19980608/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.40/specs
gcc version egcs-2.91.40 19980608 (gcc2 ss-980502 experimental)
/home/dbs/lang/egcs-19980608/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.40/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) bug2.cc /var/tmp/cca000zs.ii
GNU CPP version egcs-2.91.40 19980608 (gcc2 ss-980502 experimental) (sparc)
#include "..." search starts here:
#include <...> search starts here:
/home/dbs/lang/egcs-19980608/include/g++
/usr/local/include
/home/dbs/lang/egcs-19980608/sparc-sun-solaris2.5.1/include
/home/dbs/lang/egcs-19980608/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.40/include
/usr/include
End of search list.
/home/dbs/lang/egcs-19980608/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.40/cc1plus /var/tmp/cca000zs.ii -quiet -dumpbase bug2.cc -version -o /var/tmp/cca000zs.s
GNU C++ version egcs-2.91.40 19980608 (gcc2 ss-980502 experimental) (sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.91.40 19980608 (gcc2 ss-980502 experimental).
bug2.cc:20: Internal compiler error.
bug2.cc:20: Please submit a full bug report to `egcs-bugs@cygnus.com'.
--
Mark Richters (mr@informatik.uni-bremen.de)