[PATCH] D70172: [CUDA][HIP] Fix assertion due to dtor check on windows

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 04:43:25 PST 2019


yaxunl created this revision.
yaxunl added reviewers: tra, rjmccall.

The Microsoft ABI requires that clang performs the destructor body
checks (i.e. operator delete() lookup) when the vtable is marked used, as
the deleting destructor is emitted with the vtable, not with the
destructor definition as in the Itanium ABI. This can cause a CXXDestrcuctorDecl
to be passed to CheckDestructor even though the CXXDestrcuctorDecl is
not defined yet. Later on, if the same dtor is defined, it will be passed to
CXXDestrcuctorDecl again. This causes assertion in Sema::markKnownEmitted.

This patch fixes that by let Sema::getEmissionStatus report correct emission
state for the dtor passed to each CheckDestructor.


https://reviews.llvm.org/D70172

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/SemaCUDA/deleting-dtor.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70172.229058.patch
Type: text/x-patch
Size: 5619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191113/8616e983/attachment-0001.bin>


More information about the cfe-commits mailing list