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

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 23 09:44:27 PST 2026


================
@@ -2927,6 +2924,30 @@ class LifetimeSafetyReporterImpl : public LifetimeSafetyReporter {
         << EscapeExpr->getSourceRange();
   }
 
+  void suggestLifetimeboundToImplicitThis(SuggestionScope Scope,
+                                          const CXXMethodDecl *MD,
+                                          const Expr *EscapeExpr) override {
+    unsigned DiagID = (Scope == SuggestionScope::CrossTU)
+                          ? diag::warn_lifetime_safety_cross_tu_this_suggestion
+                          : diag::warn_lifetime_safety_intra_tu_this_suggestion;
+
----------------
usx95 wrote:

nit: remove new line

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


More information about the cfe-commits mailing list