[clang] [LifetimeSafety] Add report on misuse of clang::noescape (PR #177260)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 24 03:08:57 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(),
----------------
vbvictor wrote:

On a side note, we don't check that suggestions are correctly emitted in `clang/test/Sema/warn-lifetime-safety-suggestions.cpp`.
Probably need to refactor that test too.

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


More information about the cfe-commits mailing list