[clang] [LifetimeSafety] Add suggestion and inference for implicit this (PR #176703)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 22 09:34:53 PST 2026


================
@@ -60,6 +60,14 @@ class LifetimeSafetyReporter {
   virtual void suggestAnnotation(SuggestionScope Scope,
                                  const ParmVarDecl *ParmToAnnotate,
                                  const Expr *EscapeExpr) {}
+
+  // Suggests lifetime bound annotations for implicit this
+  virtual void suggestAnnotation(SuggestionScope Scope, const CXXMethodDecl *MD,
----------------
usx95 wrote:

Let us avoid overloading functions here and be more explicit with the names: `SuggestLifetimeboundToParmVar`and `SuggestLifetimeboundToImplicitThis`

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


More information about the cfe-commits mailing list