[qt/clang/llvm]: Summary of bulk changes made

KDE Git Services - Bulk Change <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git repository change summary for qt/clang/llvm
Pushed by mirror-service into branch 'upstream/users/yuxuanchen1997/fix-cwg1815-lambda-capture-cleanup'.
Changed from 0000000000000000000000000000000000000000 to 4b80bb0705558ad96eff4f46800ce6aee35ad87b
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.

This change contains the following new commits:

Git commit 4b80bb0705558ad96eff4f46800ce6aee35ad87b by Yuxuan Chen on 01/07/2026 at 19:22..
[Clang] Rebuild lambda capture initializers in default member initializers

Fixes https://github.com/llvm/llvm-project/issues/196469

Since the CWG1815 implementation, InitListChecker rebuilds a default member initializer at its point of use in aggregate initialization. The rebuild uses the EnsureImmediateInvocationInDefaultArgs tree transform, where TransformCXXBindTemporaryExpr strips CXXBindTemporaryExpr nodes, relying on the subexpression's rebuild to recreate the temporary binding and re-register cleanups in the current evaluation context.

However, the transform overrides TransformLambdaExpr because the lambda body is not a subexpression. Returning the original lambda unchanged skips the MaybeBindToTemporary call that BuildLambdaExpr would normally perform, so the rebuilt initializer can lack the closure temporary binding and cleanup marker. CodeGen then misses the closure destructor and init-captured members can leak.

Lambda init-capture initializers are evaluated in the enclosing context and can also contain immediate invocations or source-location expressions that need to be rebuilt at the default-initializer use site. Rebuild those initializer expressions without rebuilding the closure type, capture declarations, or body, so body references to init-capture declarations remain valid. When a capture initializer changes, create a replacement LambdaExpr that shares the existing closure and body, then bind the lambda temporary explicitly to restore cleanup emission.

Co-Authored-By: GPT-5.5 <[email protected]>
https://invent.kde.org/qt/clang/llvm/-/commit/4b80bb0705558ad96eff4f46800ce6aee35ad87b
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.