[clang] [LifetimeSafety] Introduce buildOriginFlowChain for use-after-scope (PR #199345)
via cfe-commits
cfe-commits at lists.llvm.org
Sun May 24 09:52:12 PDT 2026
================
@@ -54,14 +54,24 @@ inline bool IsLifetimeSafetyEnabled(Sema &S, const Decl *D) {
return false;
}
+inline StringRef formatExpr(const Expr *E) {
+ const Expr *PureExpr = E->IgnoreImpCasts();
+ if (const DeclRefExpr *DRExpr = dyn_cast<DeclRefExpr>(PureExpr))
+ return DRExpr->getDecl()->getName();
----------------
NeKon69 wrote:
Just a quick note: I recently found out that you can pass to diagnostics `DRExpr->getDecl()` directly. That will also add quotes to the variable names!
https://github.com/llvm/llvm-project/pull/199345
More information about the cfe-commits
mailing list