From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; NetCaptor 6.5.0PB8) Description of problem: Virtual table for the given class W misses second pointer to function W::x. The class source is: struct R { virtual void z (void) {} virtual void y (void) {} virtual R * x (void) { return this; } }; struct S : public R { }; struct W : public S { double d; virtual long k (void) { return 0l; } W * x (void) { return this; } }; According to the C++ ABI, virtual table should contain "an entry for any virtual function declared in a class, whether it is a new function or overrides a base class function, unless it overrides a function from the primary base, and conversion between their return types does not require an adjustment". [C++ ABI, 2.5.2 Virtual Table Components and Order] g++3 compiler leaves only one pointer to function W::x, i.e. g++3 decides that this is the exception case. But it's not completely clear. further reading of ABI suggests that there should be two entries for function 'W::x' for class W and R. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: Use the testcase Additional info:
But that's the correct behaviour. R is W's primary base (there is no multiple inheritance in the example), likewise conversion from W to R doesn't need any adjustements.