[clang] [LifetimeSafety] Add origin tracking for lambda captures (PR #185216)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 03:22:40 PDT 2026


================
@@ -1784,3 +1784,116 @@ void test_optional_view_arrow() {
     (void)*p;
 }
 } // namespace OwnerArrowOperator
+
----------------
usx95 wrote:

Please add a test to warn-lifetime-safety-suggestions.cpp to test for 

```
auto MakeCallback(int integer, int* ptr, const std::string& ref, std::string_view view) {
  return [&]() {Foo(integer, ptr, ref, view)};
}
```

The last 3 should get suggestions to be annotated with lifetimebound

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


More information about the cfe-commits mailing list