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

Kashika Akhouri via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 21 23:09:24 PST 2026


================
@@ -54,6 +54,8 @@ bool isAssignmentOperatorLifetimeBound(const CXXMethodDecl *CMD) {
 
 bool implicitObjectParamIsLifetimeBound(const FunctionDecl *FD) {
   FD = getDeclWithMergedLifetimeBoundAttrs(FD);
+  if (FD->hasAttr<LifetimeBoundAttr>())
----------------
kashika0112 wrote:

Done, added a new helper `addLifetimeBoundToImplicitThis` inside Reporter that adds the lifetime attribute to the TSI.

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


More information about the cfe-commits mailing list