[PATCH] D61165: Fix a crash where a [[no_destroy]] destructor was not emitted in an array

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 15:08:54 PDT 2019


erik.pilkington updated this revision to Diff 198916.
erik.pilkington marked 6 inline comments as done.
erik.pilkington added a comment.

Address review comments. Also remove the special case where we wouldn't check a destructor for an array in `-fno-exceptions` mode. This seems inconsistent with both how we're treating `-fno-exceptions` in general, and inconsistent with other cases of aggregate initialization (i.e. we still check struct members here).

In D61165#1494250 <https://reviews.llvm.org/D61165#1494250>, @rjmccall wrote:

> All of the IRGen changes in this patch are unnecessary according to the model we've worked out, right?  The fix is just to mark the destructor as still used when we're constructing an array.


Yeah, the IRGen changes were to stop clang from referencing a non-existant dtor for a global no_destroy array, but if we're using it regardless then its not necessary. New patch removes it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61165/new/

https://reviews.llvm.org/D61165

Files:
  clang/include/clang/Basic/AttrDocs.td
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaInit.cpp
  clang/test/CodeGenCXX/no_destroy.cpp
  clang/test/SemaCXX/aggregate-initialization.cpp
  clang/test/SemaCXX/no_destroy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61165.198916.patch
Type: text/x-patch
Size: 12852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190509/d31e7c98/attachment-0001.bin>


More information about the cfe-commits mailing list