[clang] [LifetimeSafety] Suggest lifetime annotations (PR #169767)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 28 00:37:17 PST 2025


================
@@ -10778,6 +10778,13 @@ def note_lifetime_safety_used_here : Note<"later used here">;
 def note_lifetime_safety_destroyed_here : Note<"destroyed here">;
 def note_lifetime_safety_returned_here : Note<"returned here">;
 
+def warn_lifetime_param_should_be_lifetimebound
----------------
usx95 wrote:

Let's follow the same naming of including lifetime_safety in the warning name.

Suggestion: warn_lifetime_safety_suggest_lifetimebound  
also let's stick with return and be explicit how it escapes. Lifetimebound can be used to denot escape by return only.

def note_lifetime_safety_suggestion_returned_here : Note<"param returned here">;

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


More information about the cfe-commits mailing list