Comment 20 for bug 305460

Revision history for this message
In , Redi (redi) wrote :

(In reply to Eyal Rozenberg from comment #16)
> The compiler could store information in the compiled object listing the
> virtual members for which no implementation was found, due to which reason
> the vtable was not defined already. In this specific example, storing the
> name of "A::B()" somewhere.

In every file that includes the header defining A?

Consider the case where you include the header in ten files, and define the virtual functions in one of them. Nine out of ten files do not contain a definitions of the virtual functions, so they would each contain the same info naming every virtual function in the class. Then do that for every polymorphic class in every object file. This is a lot more info being written out, and most of it will never be used.

You have nine files saying "this function is missing" and one not saying it. What exactly does the linker do with that information? Why would that be better than comment 7 here?