[clang] [analyzer] Add aggregate value tracking to the LifetimeModeling checker (PR #214823)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 02:37:02 PDT 2026


https://github.com/Xazax-hun requested changes to this pull request.

I think we might want to take a step back and discuss at a higher level what we want to do here. It is possible that I am misunderstanding what this PR is trying to achieve. 

Consider the following example:

```
struct S {
  int *owned;
  int *view;
  S();
  S(const S&);
  ~S();
};

S getS(S input [[clang::lifetimebound]]);
```

Here, imagine `S` has both owned data, and data that refers to some other unowned storage. The `lifetimebound` here expressed that the output `S` depends on whatever the input `S` depended on. If we recursively do the binding for all fields, we might end up introducing a false dependency on `owned`. So I think the right thing to do in this case is to consult what the input was depending on and propagate the same dependence. 



https://github.com/llvm/llvm-project/pull/214823


More information about the cfe-commits mailing list