egcs-1.1 and virtual method questions

Gilles Depeyrot
Wed Nov 18 17:05:00 GMT 1998

Le (the) 18/11/98 23:46, Martin von Loewis a écrit (wrote) :

>> In my code, with an object of class foobar manipulated with a foo pointer,
>> the do_something method which is effectively called is foo's do_something
>> instead of foobar's do_something !
>That would depend on the code. For example, if you do the virtual call
>in a constructor, things are different. Also, if you create a foo object
>before calling the method, you get foo::do_something.

Simple call such as object->do_something()

>If it is neither of these, report it as a bug.

Well I will try to find the time to extract a test case.

I've had very wierd reactions from egcs on this code (20K+ lines of very
compact code with lots of templates and stuff). It's always been bugs in
the code (that's what you would expect) but I'm stumped on this one.

The code was originally compiled with gcc 2.6.3 with extensive usage of
templates and absolutely refused to compile either under gcc 2.8.1 or egcs
1.x without lots of changes to the code (changes which have been made).

It still refuses to compile with non gcc based compilers :-)

Thanks for your help,

Gilles Depeyrot                    < >
                             < >

More information about the Gcc-bugs mailing list