[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 18:45:30 PDT 2019


ahatanak marked an inline comment as done.
ahatanak added inline comments.


================
Comment at: lib/CodeGen/CGExprAgg.cpp:248
   bool RequiresDestruction =
-      Dest.isIgnored() &&
+      !Dest.isExternallyDestructed() &&
       RetTy.isDestructedType() == QualType::DK_nontrivial_c_struct;
----------------
This change wasn't needed to fix the bugs, but I think `isExternallyDestructed` instead of `isIgnored` should be called to determine whether the returned value requires destruction.


Repository:
  rC Clang

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

https://reviews.llvm.org/D64464





More information about the cfe-commits mailing list