[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 05:27:19 PST 2026


================
@@ -2901,16 +2903,16 @@ class LifetimeSafetyReporterImpl : public LifetimeSafetyReporter {
         << EscapeExpr->getEndLoc();
   }
 
-  void suggestAnnotation(SuggestionScope Scope,
-                         const ParmVarDecl *ParmToAnnotate,
-                         const Expr *EscapeExpr) override {
+  void suggestLifetimeboundToParmVar(SuggestionScope Scope,
+                                     const ParmVarDecl *ParmToAnnotate,
+                                     const Expr *EscapeExpr) override {
     unsigned DiagID;
     switch (Scope) {
----------------
usx95 wrote:

let's use the same condtional operator instead of switch.

`unsigned DiagID = (Scope == SuggestionScope::CrossTU) ? ...`

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


More information about the cfe-commits mailing list