GCC 2.95.2: internal compiler error 159 with invalid static_cast

Marko Mäkelä Marko.Makela@HUT.FI
Mon Feb 21 05:52:00 GMT 2000


gcc version: 2.95.2
system type: Debian GNU/Linux 2.2 (kernel 2.2.7), GNU libc 2.1.2

Dear Sirs,

I was trying to do a static_cast from void* to a function pointer in
g++ and used a slightly wrong syntax.  The compiler crashed with an
internal compiler error.  Here is a simplified version of the bug
(triggered by the "const" keyword):

$ cat > /tmp/error.C << EOF
void* f;
void g () {
  static_cast<int(*)(int)const>(f) (42);     
}
EOF
$ g++ -c /tmp/error.C
/tmp/error.C: In function `void g()':
/tmp/error.C:3: Internal compiler error 159.
/tmp/error.C:3: Please submit a full bug report.
/tmp/error.C:3: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.

Best regards,

	Marko Mäkelä


More information about the Gcc-bugs mailing list