This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-2.93.13 crashes on -Woverloaded-virtual
- To: Dirk Zoller <Dirk dot Zoller at rhein-main dot netsurf dot de>
- Subject: Re: egcs-2.93.13 crashes on -Woverloaded-virtual
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Wed, 31 Mar 1999 10:16:41 +0100
- CC: egcs-bugs at egcs dot cygnus dot com, Jason Merrill <jason at cygnus dot com>
- Organization: University of Bristol
- References: <37011F6A.7E4EE6F1@rhein-main.netsurf.de>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
Dirk Zoller wrote:
> $ g++ -x c++ -v -S -Woverloaded-virtual testclient.ii
...
> testclient.ii:10869: Internal compiler error.
> testclient.ii:10869: Please submit a full bug report to
> `egcs-bugs@egcs.cygnus.com'.
> testclient.ii:10869: See <URL:http://egcs.cygnus.com/faq.html#bugreport>
> for details.
thanks for the bug report. It is indeed a bug in the implementation of
-Woverloaded-virtual. Your program boiled down to the following (legal) test
case,
struct A
{
virtual int geterror();
};
struct B : public A
{
static int geterror(int);
virtual int geterror();
};
The innards of -Woverloaded-virtual didn't check that B::geterror(int) was
static and died. The behaviour of -Woverloaded-virtual is known to be
incomplete, however it is not decided on what the correct behaviour should be
(other than not crashing of course). For the moment you'll have to forgo use of
the -Woverloaded-virtuals switch (sorry).
Jason -
I think this shows that we do need to do something about the overloaded-virtual
warning. I'm quite willing to work on addressing your points
(http://egcs.cygnus.com/ml/egcs-patches/1999-03/msg00488.html), but would it be
acceptable to have separate switches? Might I suggest
-Woverriding-virtuals
close but not exact matches (the patch I submitted)
-Woverloaded-members
close hidden base members. Those where you'll get `unexpected' derrived
functions called rather than the base member. Both virtual and non-virtual
members are checked.
-Woverloaded-virtuals
-Woverriding-virtuals plus -Woverloaded-members for virtual base fns.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk