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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 15:12:32 PDT 2019


rjmccall added a comment.

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.



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:13119
+  // variable is static local array and exceptions are enabled, since then we
+  // need to clean up the elements.
+  if (VD->isNoDestroy(getASTContext()) &&
----------------
This isn't "emitting" the destructor, it's "using" it.  Also, the comment should make it clear that this is about aggregate initialization in general, and it should contain a FIXME if there's part of that rule we're not implementing correctly.


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

https://reviews.llvm.org/D61165





More information about the cfe-commits mailing list