[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 Apr 30 16:46:37 PDT 2019


rjmccall added a comment.

Hmm.  You know, there's another case where the destructor can be called even for a non-array: if constructing the object requires a temporary, I believe an exception thrown from that temporary's destructor is supposed to go back and destroy the variable.  (This is, sadly, not entirely clear under the standard since the object is not automatic.)  Now, Clang does not actually get this correct — we abort the construction, but we don't destroy the variable — but (1) we should fix that someday and (2) in the meantime, we shouldn't implement something which will be a problem when we go to fix that.

This doesn't affect non-locals because there the exception will call `std::terminate()` as specified in [except.terminate]p1.



================
Comment at: clang/include/clang/Basic/AttrDocs.td:3893
+    ~only_no_destroy();
+  }
+
----------------
Missing semicolon.


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

https://reviews.llvm.org/D61165





More information about the cfe-commits mailing list