[clang] [llvm] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)
Haojian Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 20 03:34:21 PST 2024
================
@@ -1460,7 +1497,15 @@ void checkExprLifetime(Sema &SemaRef, const AssignedEntity &Entity,
checkExprLifetimeImpl(SemaRef, /*InitEntity=*/nullptr,
/*ExtendingEntity=*/nullptr, LK_Assignment, &Entity,
- Init);
+ /*CapEntity=*/nullptr, Init);
+}
+
+void checkCaptureByLifetime(Sema &SemaRef, const CapturingEntity &Entity,
+ Expr *Init) {
----------------
hokein wrote:
Nit: we could consider disabling the analysis entirely when capture diagnostics are off.
https://github.com/llvm/llvm-project/pull/115921
More information about the llvm-commits
mailing list