[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:08:35 PST 2026
================
@@ -610,10 +610,18 @@ void FactsGenerator::markUseAsWrite(const DeclRefExpr *DRE) {
// parameter at the function's entry.
llvm::SmallVector<Fact *> FactsGenerator::issuePlaceholderLoans() {
const auto *FD = dyn_cast<FunctionDecl>(AC.getDecl());
- if (!FD)
+ if (!FD || FD->isImplicit())
----------------
kashika0112 wrote:
After the recent updates to `implicitObjectParamIsLifetimeBound` function where we're iterating all the redecls, the `FD->isImplicit()` and the if-else condition in new `suggestAnnotation` overload is no longer required. Earlier it was crashing and I was getting warnings in `struct [[gsl::pointer]] View`.
https://github.com/llvm/llvm-project/pull/176703
More information about the cfe-commits
mailing list