[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 25 16:56:49 PST 2025


================
@@ -515,7 +515,8 @@ Warning flags
   + ``-Wthread-safety-analysis``: The core analysis.
   + ``-Wthread-safety-precise``: Requires that mutex expressions match precisely.
        This warning can be disabled for code which has a lot of aliases.
-  + ``-Wthread-safety-reference``: Checks when guarded members are passed by reference.
+  + ``-Wthread-safety-reference``: Checks when guarded members are passed or
+    returned by reference.
----------------
aaronpuchert wrote:

Technically, returning is covered by a subflag `-Wthread-safety-reference-return` which we apparently forget to document. On the other hand, we might also get rid of that at some point, it was mainly introduced to ease migration, not because we had evidence that users might want a warning on passing but not on returning.

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


More information about the cfe-commits mailing list