[clang] [LifetimeSafety] Suppress annotation inference for owner-capturing constructors (PR #223635)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 15 04:28:55 PDT 2026


================
@@ -387,6 +387,11 @@ bool isGslOwnerType(const CXXRecordDecl *RD) {
   return isRecordWithAttr<OwnerAttr>(RD);
 }
 
+bool isOwnerPtrCtor(const CXXConstructorDecl *Ctor, const ParmVarDecl *PVD) {
+  return Ctor && PVD->getType()->isPointerType() &&
----------------
Xazax-hun wrote:

I wonder if we want to make this wider, what if an owner takes a span, string_view or something similar but still captures it? 

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


More information about the cfe-commits mailing list