[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 07:59:30 PST 2025


================
@@ -1,7 +1,9 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wthread-safety -Wthread-safety-beta -Wno-thread-safety-negative -fcxx-exceptions -DUSE_CAPABILITY=0 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wthread-safety -Wthread-safety-beta -Wno-thread-safety-negative -fcxx-exceptions -DUSE_CAPABILITY=1 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wthread-safety -Wthread-safety-beta -Wno-thread-safety-negative -Wthread-safety-addressof -fcxx-exceptions -DUSE_CAPABILITY=1 -DCHECK_ADDRESSOF %s
----------------
aaronpuchert wrote:

Some goes here: the test is really big and I don't want a combinatorial explosion. We're also having `-beta` on by default, so there is no reason to have `-addressof` separately. (We have `-negative` separately because it's a different kind of analysis.)

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


More information about the cfe-commits mailing list