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

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 03:51:42 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()();
-}
+}
----------------
Xazax-hun wrote:

NIt: add back the end of line at the end of the file.

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


More information about the cfe-commits mailing list