Rename 'free' in warning messages to 'release' (#150935)
Changed the warning message:
- **From**: 'Attempt to free released memory'
**To**: 'Attempt to release already released memory'
- **From**: 'Attempt to free non-owned memory'
**To**: 'Attempt to release non-owned memory'
- **From**: 'Use of memory after it is freed'
**To**: 'Use of memory after it is released'
All connected tests and their expectations have been changed
accordingly.
Inspired by [this
PR](https://github.com/llvm/llvm-project/pull/147542#discussion_r2195197922)
GitOrigin-RevId: f0c90dfcd8f2b641c17db578bdfeb9b02994e06b
diff --git a/test/clang-tidy/infrastructure/static-analyzer-config.cpp b/test/clang-tidy/infrastructure/static-analyzer-config.cpp
index 725f877..6a9641e 100644
--- a/test/clang-tidy/infrastructure/static-analyzer-config.cpp
+++ b/test/clang-tidy/infrastructure/static-analyzer-config.cpp
@@ -16,5 +16,5 @@
void *p = my_malloc(12);
my_free(p);
free(p);
- // CHECK: warning: Attempt to free released memory [clang-analyzer-unix.Malloc]
+ // CHECK: warning: Attempt to release already released memory [clang-analyzer-unix.Malloc]
}
diff --git a/test/clang-tidy/infrastructure/static-analyzer.cpp b/test/clang-tidy/infrastructure/static-analyzer.cpp
index af9693a..c45f219 100644
--- a/test/clang-tidy/infrastructure/static-analyzer.cpp
+++ b/test/clang-tidy/infrastructure/static-analyzer.cpp
@@ -7,12 +7,12 @@
int *p = new int(42);
delete p;
delete p;
- // CHECK: warning: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete]
+ // CHECK: warning: Attempt to release already released memory [clang-analyzer-cplusplus.NewDelete]
}
void g() {
void *q = malloc(132);
free(q);
free(q);
- // CHECK: warning: Attempt to free released memory [clang-analyzer-unix.Malloc]
+ // CHECK: warning: Attempt to release already released memory [clang-analyzer-unix.Malloc]
}