[clang] Thread Safety Analysis: Basic capability alias-analysis (PR #142955)
DeLesley Hutchins via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 13 16:35:56 PDT 2025
================
@@ -7546,6 +7546,15 @@ void testRecursiveAssign() {
f->mu.Unlock();
}
+// A strange pattern that no sane person should write...
+void testStrangePattern(Mutex *&out, int &x) {
----------------
delesley wrote:
In keeping with my previous comment, I would want to see a test case that shows that this change does *not* reduce analysis accuracy by incorrectly conflating mutexes that should be distinct.
With respect to the strange pattern, if this is not something that any sane person would write, should we really support it in the analysis? My personal inclination would be to ditch this particular commit as being a change that (a) may introduce problems, and (b) does not actually solve anything. ;-)
https://github.com/llvm/llvm-project/pull/142955
More information about the cfe-commits
mailing list