[clang] [Clang][CodeGen] Track EH cleanup depth for guarded init and pop correctly (PR #199508)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 18 16:47:08 PDT 2026
efriedma-quic wrote:
The patch looks mechanically correct: if we want to allow defining automatic duration blocks inside a static initializer, we need a boolean like you've outlined.
You should be able to check for the presence of a block by looking at the cleanups in the ExprWithCleanups.
-----
Having said that, these semantics are not helpful to users. If we can't reach an agreement on changing the lifetime extension rules here, I'd rather just reject the construct (with an error in Sema).
https://github.com/llvm/llvm-project/pull/199508
More information about the cfe-commits
mailing list