Description
See llvm/llvm-project#70585 for the motivation issue.
Simply, the current clang's behavior violates itanium ABI 5.2.3:
The virtual table for a class is emitted in the same object containing the definition of its key function, i.e. the first non-pure virtual function that is not inline at the point of class definition.
But there are opinions about: is the concept of key function necessary after we introducing modules? So I bring the issue here.
My thought about the key function is that: in the headers model, the class may be defined in many TUs, then we need to find a TU to generate the virtual table. But after we introducing modules, if we define the class is defined is a module purview, we can get the TU to generate the virtual table naturally.
My understanding to the issues is: while the original old rule works, maybe it is better to have some new rules with the new features technically.