[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 6 14:13:21 PST 2025


================
@@ -43,7 +43,7 @@ struct LivenessInfo {
   /// multiple uses along different paths, this will point to the use appearing
   /// earlier in the translation unit.
   /// This is 'null' when the origin is not live.
-  const UseFact *CausingUseFact;
+  const Fact *CausingFact;
----------------
usx95 wrote:

We can use `llvm::PointerUnion<UseFact*, OriginEscapeFact* >` to be explicit what can appear here.

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


More information about the cfe-commits mailing list