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]

Re: egcs-2.93.13 crashes on -Woverloaded-virtual


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


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