[clang] [LifetimeSafety] Introduce buildOriginFlowChain for use-after-scope (PR #199345)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 01:14:14 PDT 2026


================
@@ -471,13 +474,47 @@ class LifetimeSafetySemaHelperImpl : public LifetimeSafetySemaHelper {
   }
 
   std::string getDiagSubjectDescription(const Expr *E) {
+    E = E->IgnoreImpCasts();
     if (isa<MaterializeTemporaryExpr>(E))
       return "local temporary object";
 
     if (const auto *DRE = dyn_cast<DeclRefExpr>(E))
       return getDiagSubjectDescription(DRE->getDecl());
     // TODO: Handle other expression types.
-    return "";
+    return "expression";
+  }
+
+  bool shouldShowInAliasChain(const Expr *CurrExpr, const Expr *LastExpr) {
+    CurrExpr = CurrExpr->IgnoreImpCasts();
----------------
Xazax-hun wrote:

Same concern about reusing some function to skip some node types if we have any. 

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


More information about the cfe-commits mailing list