[clang] [LifetimeSafety] Add report on misuse of clang::noescape (PR #177260)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 22 03:16:24 PST 2026
================
@@ -2927,6 +2927,17 @@ class LifetimeSafetyReporterImpl : public LifetimeSafetyReporter {
<< EscapeExpr->getSourceRange();
}
+ void reportNoescapeViolation(const ParmVarDecl *ParmWithNoescape,
+ const Expr *EscapeExpr) override {
+ S.Diag(ParmWithNoescape->getBeginLoc(),
----------------
Xazax-hun wrote:
I think we should be able to generate a fixit hint that removes the annotation. Although, admittedly, that would only suggest removing at one of the declarations, that we report on. And preferably, the user needs to remove the annotation from all of the redeclarations.
https://github.com/llvm/llvm-project/pull/177260
More information about the cfe-commits
mailing list