[clang] [CIR] Implement handling for lambda capture of destructured types (PR #191316)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 10 11:54:20 PDT 2026
================
@@ -316,11 +319,34 @@ void CIRGenFunction::popCleanupBlock() {
? scope.getActiveFlag()
: Address::invalid();
- bool requiresNormalCleanup = scope.isNormalCleanup();
+ // When deactivating, suppress normal cleanup emission. The cleanup should
+ // not fire on the normal exit path. EH cleanup is still needed so that
+ // exceptions during the body are handled.
+ bool requiresNormalCleanup = scope.isNormalCleanup() && !forDeactivation;
bool requiresEHCleanup = scope.isEHCleanup();
+ // When deactivating a cleanup that still needs EH protection, downgrade
----------------
andykaylor wrote:
The comments were AI generated, but I've read them and edited some. They seem reasonable to me. This comment in particular is explaining something that was causing me problems during the development of this patch, so I thought an explanation was needed. Does it not make sense to you?
https://github.com/llvm/llvm-project/pull/191316
More information about the cfe-commits
mailing list