This fixes building Qt as shared libraries with clang in MinGW mode; previously subclasses of the QObjectData class (in other DLLs than the base DLL) failed to find the typeinfo symbols (that neither were emitted in the base DLL or in the subclass component).
If the virtual destructor in the newly added testcase wouldn't be pure (or if there'd be another non-pure virtual method), it'd be a key function and things would work out as intended. Make sure to locally emit the typeinfo for those classes as well.
This matches what GCC does in this specific testcase (although it's unclear whether the generic mechanics are the same or different).
This fixes the root issue that spawned PR35146. The difference to GCC that is described in that bug still is present though.
I admit that this is a kinda hack-and-slash type of fix since I don't really understand how all these concepts fit together. Better suggestions on solving that particular issue are welcome.
Maybe a comment like "VTables of classes declared as dllimport are always considered to be external." ?