[clang] [llvm] [LifetimeSafety] Add lifetimebound inference for std::make_unique (PR #191632)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 03:44:51 PDT 2026


================
@@ -221,6 +221,17 @@ void Sema::inferGslOwnerPointerAttribute(CXXRecordDecl *Record) {
   inferGslPointerAttribute(Record, Record);
 }
 
+static const CXXNewExpr *findCXXNewExpr(const Stmt *S) {
+  if (!S)
+    return nullptr;
+  if (const auto *E = dyn_cast<CXXNewExpr>(S))
+    return E;
+  for (const Stmt *Child : S->children())
+    if (const CXXNewExpr *E = findCXXNewExpr(Child))
----------------
usx95 wrote:

Added a note.

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


More information about the cfe-commits mailing list