[cxx-abi-dev] Emission of vtables with a later-declared inline key function

Sean Hunt scshunt at csclub.uwaterloo.ca
Mon Nov 5 17:07:58 UTC 2012


Section 5.2.3 says "Note that if the key function is not declared
inline in the class definition, but its definition later is always
declared inline, it will be emitted in every object containing the
definition."

I submit that this should be changed, so that if the key function is
later declared inline, the vtable is emitted only if used in that TU.
If the key function is inline, it must be defined in every TU in which
it is odr-used, and since it is necessarily virtual and non-pure, it
is odr-used in every TU containing a definition of the class. Hence
any TU which may see a definition of the class also necessarily
contains a definition of the key function, so we are no better off by
selecting this key function than we would be if the function were
declared inline in the class declaration.

Sean


More information about the cxx-abi-dev mailing list