[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

Kashika Akhouri via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 7 00:48:53 PST 2025


================
@@ -10728,8 +10728,19 @@ def warn_lifetime_safety_loan_expires_permissive : Warning<
 def warn_lifetime_safety_loan_expires_strict : Warning<
    "object whose reference is captured may not live long enough">,
    InGroup<LifetimeSafetyStrict>, DefaultIgnore;
+
+def warn_lifetime_safety_return_stack_addr_permissive
+    : Warning<"returning reference to stack allocated object">,
----------------
kashika0112 wrote:

Done, have updated the test cases as well.

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


More information about the cfe-commits mailing list