This matches what GCC does in these situations.
This fixes compiling Qt in debug mode. In release mode, references to the vtable of this particular class ends up optimized away, but in debug mode, the compiler creates references to the vtable, which is expected to be dllexported from a different DLL. Make sure the dllexported version actually ends up emitted.
This may be too early, you can get into situations like this if you start emitting the vtable (which will emit inline methods) before we get to the end of the outermost class. See this bug for example:
https://bugs.llvm.org/show_bug.cgi?id=40006
Maybe if you have a dllexported nested class with a virtual method that references the constructor of the outer class which has a late-parsed member initializer... you can get things to go wrong as in the bug above.
I think the fix will be to touch the vtable when we process delayed dllexported classes from the list just above this line.