[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

Michael Flanders via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 12:18:16 PST 2025


================
@@ -18,8 +18,8 @@ struct myfunction {
 myfunction create_func() {
   int n;
   auto c = [&n] {};
-  return c; // expected-warning {{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller.  This will be a dangling reference}}
+  return c; // expected-warning {{Address of stack memory associated with local variable 'n' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller.  This will be a dangling reference}}
 }
 void gh_66221() {
   create_func()();
-}
+}
----------------
Flandini wrote:

Fixed in 6a2a01f

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


More information about the cfe-commits mailing list