[PATCH] D125936: [Sema] Relax an assertion in BuildStmtExpr

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 16 22:08:40 PDT 2022


ahatanak added inline comments.


================
Comment at: clang/lib/CodeGen/CGStmt.cpp:2291
+  // statement.
+  CodeGenFunction::RunCleanupsScope Cleanups(*this);
+
----------------
rjmccall wrote:
> Do we need to do anything special when entering the full expressions to make sure that enclosing-block features like blocks and C compound literals have the right lifetime?
I don't think there is anything special we have to do here. The cleanups for both blocks and C compound literals are pushed by calling `pushLifetimeExtendedDestroy` so that their lifetime is extended till the end of the enclosing scope.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125936



More information about the cfe-commits mailing list