c++/5749: Internal compiler error

tHE rEAL uSER metaf4@pseudonym.org
Fri Feb 22 02:32:00 GMT 2002


Hello Maintainers !
===================

> Synopsis: Internal compiler error
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: rodrigc
> State-Changed-When: Thu Feb 21 20:39:02 2002
> State-Changed-Why:
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5749

Currently I can't update my compiler to figured out what's wrong.
c++ 2.95.2 did not give me any warnings or hints.
(c++ cpp_ptr.cpp -Wall -W -Wtraditional -pedantic -ansi
-Wbad-function-cast)

Perhaps can fix the code with braces like that, but I don't believe in:
	void (ZClass::*xxptr[3])() = { (&ZClass::draw1), (&ZClass::draw2), 0 };

Can you submit your compiler options ?

There is a new interesting fact in the main function: the problem seems
to be in the index. All numbers greater or equal than 3 crashes the
compiler, except we have one or zero argument.

int main(){
	// *** this abort my compiler
        // void (ZClass::*xxptr[3])() = { &ZClass::draw1,
&ZClass::draw2, 0 };
        // void (ZClass::*xxptr[3])() = { &ZClass::draw1 };
        // void (ZClass::*xxptr[4])() = { &ZClass::draw1 };
        // void (ZClass::*xxptr[5])() = { &ZClass::draw1 };
        // void (ZClass::*xxptr[6])() = { &ZClass::draw1 };
        // void (ZClass::*xxptr[16])() = { &ZClass::draw1 };
        // void (ZClass::*xxptr[10])() = { &ZClass::draw1 };

	// but this works
        // void (ZClass::*xxptr[2])() = { &ZClass::draw2, 0 };
        // void (ZClass::*xxptr[3])() = { 0 };
        return 0;
}

Thomas Graf



More information about the Gcc-bugs mailing list