[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 01:10:17 PDT 2024


================
@@ -408,7 +405,8 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call,
     // Once we initialized a value with a reference, it can no longer dangle.
     if (!Value) {
       for (const IndirectLocalPathEntry &PE : llvm::reverse(Path)) {
-        if (PE.Kind == IndirectLocalPathEntry::GslReferenceInit)
+        if (PE.Kind == IndirectLocalPathEntry::GslReferenceInit ||
----------------
usx95 wrote:

Can you move this to a separate function (like we do for `pathOnlyHandlesGslPointer`) and document what it is supposed to check.

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


More information about the cfe-commits mailing list