Internal compiler error when mistakenly taking the address of a pure virtual method
Kalle Dalheimer
kalle@dalheimer.hh.eunet.de
Tue Aug 11 07:26:00 GMT 1998
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!
More information about the Gcc-bugs
mailing list