[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 20 10:09:26 PDT 2024


================
@@ -478,13 +449,32 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call,
       CheckCoroObjArg = false;
     if (implicitObjectParamIsLifetimeBound(Callee) || CheckCoroObjArg)
       VisitLifetimeBoundArg(Callee, ObjectArg);
+    else if (EnableLifetimeWarnings) {
----------------
usx95 wrote:

IIUC, this option can even be completely removed from the parameters. We could just check whether the `dangling-gsl` warning is enabled or not in `VisitGSLPointerArg` and early exit if this is disabled.

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


More information about the cfe-commits mailing list