================
@@ -704,10 +704,10 @@ void FactsGenerator::handleFunctionCall(const Expr *Call,
         assert(!Args[I]->isGLValue() || ArgList->getLength() >= 2);
         ArgList = getRValueOrigins(Args[I], ArgList);
       }
-      if (isGslOwnerType(Args[I]->getType())) {
-        // The constructed gsl::Pointer borrows from the Owner's storage, not
-        // from what the Owner itself borrows, so only the outermost origin is
-        // needed.
+      if (isGslOwnerType(Args[I]->getType()) || IsArgLifetimeBound(I)) {
+        // The constructed gsl::Pointer is dependent on the argument itself, 
not
----------------
Xazax-hun wrote:

I think the reason why you might get a warning here because the lifetimebound 
in the outer span's ctor is bound to a temporary inner span. 

What about something like:
```
void test2() {
  Span<Span<Vec<int>>> outer;
  Span<Vec<int> inner;
  {
    Vec<int> v{5};
    inner = Span(v);
    outer = Span(inner);
  }
  use(**outer);
}
```
?

https://github.com/llvm/llvm-project/pull/189907
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to