[cxx-abi-dev] Non-cloned [cd]tors

de Dinechin, Christophe (Integrity VM) christophe.de-dinechin at hp.com
Thu Nov 19 09:08:41 UTC 2009


> My recollection is that they were all supposed to be emitted in a
> single COMDAT group, and that if you provided a definition of any one, you had
> to provide all of them.  That way it doesn't matter which of those
> COMDAT groups you ended up with.  The expectation was that they were in
> fact multiple entry points, and thus the fact that you had to emit all
> of them together was no big deal.

That's also my recollection, and Dennis confirmed that this is how we did it.

However, Jason's point that multiple compilers may end up making different choices remain interesting. Shouldn't we at least attempt to explain the rationale of how this is supposed to work if the compiler for the derived class and base class are different? As Dennis wrote, right now it requires way too much implicit knowledge. It breaks easily, say if one of the compilers optimizes away an "unneeded" constructor from one of the COMDATs. So we need to make it clear why a compiler must emit constructors that it doesn't need.

Just $.02 from a rusty old friend who forgot everything about C++...
Christophe



More information about the cxx-abi-dev mailing list