[clang] [LifetimeSafety] Add warning for member functions returning field origins (PR #229784)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 05:26:53 PDT 2026


================
@@ -11148,6 +11148,14 @@ def warn_lifetime_safety_noescape_escapes
       InGroup<LifetimeSafetyNoescape>,
       DefaultIgnore;
 
+def warn_lifetime_safety_field_origin_escape
+    : Warning<"return value depends on the lifetime of the object referenced by %0, which cannot be expressed with [[clang::lifetimebound]]">,
----------------
Xazax-hun wrote:

I wonder if we want to tone down this message, because in some cases it CAN be expressed (if the pointer/view is owned).

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


More information about the cfe-commits mailing list