[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 22 00:44:57 PDT 2024
================
@@ -18,29 +18,42 @@
namespace clang::sema {
-/// Describes an entity that is being assigned.
-struct AssignedEntity {
- // The left-hand side expression of the assignment.
- Expr *LHS = nullptr;
+struct CapturingEntity {
----------------
hokein wrote:
+1.
I'd not change the existing the `AssignedEntity`, as this structure is designed for the assignment case.
It looks like for the capture_by case, we only need the `Expression`, I think we could use `Expr*` directly in the function parameter, e.g. `void checkCaptureLifetime(Sema &SemaRef, const Expr* Entity, Expr *Captured);`.
https://github.com/llvm/llvm-project/pull/111499
More information about the cfe-commits
mailing list