https://github.com/usx95 created 
https://github.com/llvm/llvm-project/pull/174741

None

>From 31821fad00977f51d838c0dea394b06e1d55547a Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena <[email protected]>
Date: Tue, 16 Dec 2025 12:13:42 +0000
Subject: [PATCH] only-for-owners

---
 clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp 
b/clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
index 2772fe20de19b..f6afc43843a82 100644
--- a/clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
+++ b/clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
@@ -99,7 +99,8 @@ bool shouldTrackImplicitObjectArg(const CXXMethodDecl 
*Callee) {
   if (!isGslPointerType(Callee->getFunctionObjectParameterType()) &&
       !isGslOwnerType(Callee->getFunctionObjectParameterType()))
     return false;
-  if (isPointerLikeType(Callee->getReturnType())) {
+  if (isPointerLikeType(Callee->getReturnType()) &&
+      isGslOwnerType(Callee->getFunctionObjectParameterType())) {
     if (!Callee->getIdentifier())
       return false;
     return llvm::StringSwitch<bool>(Callee->getName())

_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to