Internal compiler error

Christopher Grinton cgg@osa.com.au
Tue Sep 16 18:43:00 GMT 1997


First of all, let me say thanks for the great work everyone is doing
on the egcs project; it is exciting to see some of the latest
developments that have been going on with gcc.

The following code causes an internal compiler error with egcs-970910
(seg fault at the call to comptypes at call.c:5642 because the
arguments TREE_OPERAND (ics[12], 0) to the TREE_TYPE macros are both
0).

It compiles without error using g++ 2.7.2.1 which is not correct
either, since the == in f is ambiguous (candidates are
operator==(int,int) and operator==(const MyInt&, const MyInt&)).

I am running Debian linux 2.0.30. If you would like any more
information about my system, please let me know.

class MyInt
{
public:
	MyInt(int = 0) {}
	operator int() const {return 2;}
};

bool operator==(const MyInt& a, const int& b)
{
	return (int)a == b;
}

bool operator==(const MyInt& a, const MyInt& b)
{
	return (int)a == (int)b;
}

bool f()
{
	return 3 == MyInt();
}

Regards,
Chris
------------------------------------------------------------
Christopher Grinton                     cgg@osa.com.au
Open Software Associates Limited
29 Ringwood Street / PO Box 4414        Phone +613 9871 1646
Ringwood, VIC  3134, AUSTRALIA          Fax   +613 9871 1711
------------------------------------------------------------
   Deploy Applications across the Internet and Intranets!
	  Visit our Web site at http://www.osa.com



More information about the Gcc-bugs mailing list