[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:48 PST 2025


================
@@ -4955,13 +4968,18 @@ class Foo {
     //showDataCell(*datap2_); // xpected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
 
     int a = data_[0];       // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
+
+    (void)&data_ao_;      // expected-warning {{reading variable 'data_ao_' requires holding mutex 'mu_'}}
+    showData(&data_ao_);  // expected-warning {{reading variable 'data_ao_' requires holding mutex 'mu_'}}
----------------
aaronpuchert wrote:

This is probably not so relevant. This test exists to call `const` overloads of operators, but you only defined one overload.

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


More information about the cfe-commits mailing list