================
@@ -1239,11 +1239,12 @@ static AnalysisResult analyzePathForGSLPointer(const 
IndirectLocalPath &Path,
     }
     // Check the return type, e.g.
     //   const GSLOwner& func(const Foo& foo [[clang::lifetimebound]])
+    //   GSLOwner* func(cosnt Foo& foo [[clang::lifetimebound]])
     //   GSLPointer func(const Foo& foo [[clang::lifetimebound]])
     if (FD &&
-        ((FD->getReturnType()->isReferenceType() &&
+        ((FD->getReturnType()->isPointerOrReferenceType() &&
           isRecordWithAttr<OwnerAttr>(FD->getReturnType()->getPointeeType())) 
||
-         isPointerLikeType(FD->getReturnType())))
+          isGLSPointerType(FD->getReturnType())))
----------------
usx95 wrote:

Does it mean that only `gsl::Pointer` return types are supported ?

For example `std::unique_ptr` in `int* x = make_unique<int>(1).get();`
https://godbolt.org/z/73bTWd48b
I think this would stop working ?

https://github.com/llvm/llvm-project/pull/127460
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to