[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:23 PST 2026


================
@@ -10834,6 +10834,12 @@ def warn_lifetime_safety_cross_tu_suggestion
 
 def note_lifetime_safety_suggestion_returned_here : Note<"param returned here">;
 
+def warn_lifetime_safety_noescape_escapes
+    : Warning<
+          "parameter is marked [[clang::noescape]] but escapes through return">,
----------------
Xazax-hun wrote:

I wonder if we can eliminate the `through return` part from the warning message since we already add a note about the return. 

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


More information about the cfe-commits mailing list