[clang] [Lifetime Safety] Highlight lifetimebound calls in alias chain diagnostics (PR #206337)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 13 02:42:16 PDT 2026


================
@@ -664,20 +664,66 @@ class LifetimeSafetySemaHelperImpl : public LifetimeSafetySemaHelper {
     return CurrExpr->getSourceRange() != LastExpr->getSourceRange();
   }
 
+  bool shouldCarryHiddenLifetimeBound(const Expr *HiddenExpr,
----------------
iitianpushkar wrote:

That was my initial assumption too but in the above failing case they are not both wrappers around the same original call expression.

For `pp = Pointer(p)`, the hidden expression carrying the lifetimebound info can be the constructor expression for `Pointer(p)` while `LastExpr` is the argument/source expression `p` that the visible alias note is about.

So the pair is more like:

```text
HiddenExpr: Pointer(p)
LastExpr:   p
```
rather than :
```
HiddenExpr: wrapper around Pointer(p)
LastExpr:   another wrapper around Pointer(p)
```

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


More information about the cfe-commits mailing list