This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error when mistakenly taking the address of a pure virtual method


Hi,

on Linux 2.0.33 Intel, egcs 1.03a, I get an internal compiler error for the
following (admittedly wrong) code:

class Base
{
	virtual bool isSomething() const = 0;
};

class Derived : public Base
{
	virtual bool isSomething() const { return false; }
};

int main( int argc, char* argv [] )
{
	Base* derived = new Derived();
	bool ret = derived->isSomething; // internal compiler error
}

When I put the parentheses after isSomething in the last but one line,
everything is fine.

Just in case, here is the output of g++ -v:

Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)   

Hope this helps; let me know if you need further information.

Kalle

--
Kalle Dalheimer              Contract programming for Unix
kalle@dalheimer.de           Technical writing
kalle@kde.org                Technical editing
kalle@oreilly.de             KDE Developer (MFCH)
mdalheimer@acm.org           It's open, it's source, it runs - must be KDE!
	


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]