[MS] Mark vbase dtors used when marking dtor used
authorReid Kleckner <rnk@google.com>
Tue, 11 Feb 2020 00:16:17 +0000 (16:16 -0800)
committerReid Kleckner <rnk@google.com>
Thu, 9 Apr 2020 21:19:36 +0000 (14:19 -0700)
commit55efb68c19b4911f780ec4d074f8ff2f8529883f
treeebfec7e96d703afcf6d2da100f89997ffb3eb5d3
parent994d84b9192eba70369a4b65f0193c4545ae021b
[MS] Mark vbase dtors used when marking dtor used

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

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D77081
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/CXX/class.access/p4.cpp
clang/test/CodeGenCXX/microsoft-abi-vbase-dtor.cpp [new file with mode: 0644]
clang/test/SemaCXX/ms-implicit-complete-dtor.cpp [new file with mode: 0644]