[llvm-branch-commits] [clang] [LifetimeSafety] Add support for GSL Pointer types (PR #154009)
Gábor Horváth via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Aug 25 12:43:12 PDT 2025
================
@@ -433,6 +433,31 @@ class FactGeneratorVisitor : public ConstStmtVisitor<FactGeneratorVisitor> {
void VisitDeclRefExpr(const DeclRefExpr *DRE) { handleUse(DRE); }
+ void VisitCXXConstructExpr(const CXXConstructExpr *CCE) {
+ if (!isGslPointerType(CCE->getType()))
+ return;
+
+ if (CCE->getNumArgs() > 0 && hasOrigin(CCE->getArg(0)->getType()))
----------------
Xazax-hun wrote:
I am a bit worried about cases where a view takes an iterator range, chances are good we might not have origins for those iterator types and we would mistakenly think we borrow from these iterators.
https://github.com/llvm/llvm-project/pull/154009
More information about the llvm-branch-commits
mailing list