[clang] [LifetimeSafety] Add multi-block support to buildOriginFlowChain (PR #204592)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 27 09:42:01 PDT 2026


================
@@ -3961,3 +3985,45 @@ PtrWithInt f() {
 View suggestion_disabled_test(View a) {
   return a;
 }
+
+//===----------------------------------------------------------------------===//
----------------
usx95 wrote:

more ideas:
```

void test_cyclic_cfg(int n) {
  View v;
  {
    MyObj a;
    View p;
    p = a; // expected-warning {{does not live long enough}}
    while (n > 0) {
      p = p; 
      n--;
    }
    v = p; // expected-note {{aliases}}
  } // expected-note {{destroyed here}}
  v.use(); // expected-note {{later used here}}
}
```

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


More information about the cfe-commits mailing list