[clang] [analyzer] Fix false positive when a lifetimebound method is called during destruction (PR #210801)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 20 14:03:28 PDT 2026


https://github.com/Xazax-hun commented:

Oh, I think this might not be the false positive fix I anticipated. 

I was wondering if you see false positives of this form:

```
void f(std::vector<S>& v) {
  int *p = nullptr;
  {
    auto s = make();
    p = s.get();
    v.push_back(std::move(s));
  }
  *p = 42;
}
```

Here, the lifetime of the local `s` ended, but its storage is still alive since it was transferred to an object inside `v`. 

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


More information about the cfe-commits mailing list