In the MS C++ ABI, the complete destructor variant for a class with
virtual bases is emitted whereever it is needed, instead of directly
alongside the base destructor variant. The complete destructor calls the
base destructor of the current class and the base destructors of each
virtual base. In order for this to work reliably, translation units that
use the destructor of a class also need to mark destructors of virtual
bases of that class used.
Fixes PR38521
"declared" in comment but "defined" in function name. Which is it?
I wonder if perhaps the right answer is neither: if we had separate Decls for the complete and base destructors, this would be tracked by the "used" bit on the complete object destructor. So perhaps isCompleteDestructorUsed and setCompleteDestructorUsed would make sense? (We could consider tracking this on the destructor instead of here, but I suppose tracking it here gives us the serialization and merging logic for free.)