[clang] [LifetimeSafety] Flow origins from lifetimebound args in `gsl::Pointer` construction (PR #189907)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 12:38:47 PDT 2026


================
@@ -712,6 +712,12 @@ void FactsGenerator::handleFunctionCall(const Expr *Call,
             CallList->getOuterOriginID(), ArgList->getOuterOriginID(),
             KillSrc));
         KillSrc = false;
+      } else if (IsArgLifetimeBound(I)) {
+        // A lifetimebound argument may affect the result at every origin level,
+        // so we propagate the whole OriginList instead of only the outermost
+        // origin.
+        flow(CallList, ArgList, KillSrc);
----------------
NeKon69 wrote:

BTW, I tried finding a test case where my code would crash, but I couldn’t find one. Could you please expand your example?

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


More information about the cfe-commits mailing list