[PATCH] D84604: Thread safety analysis: Consider global variables in scope

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 25 10:49:19 PDT 2020


lebedev.ri added inline comments.


================
Comment at: clang/test/SemaCXX/warn-thread-safety-negative.cpp:87-89
+  void test4() {
+    MutexLock lock(&mu); // expected-warning {{acquiring mutex 'mu' requires negative capability '!mu'}}
+  }
----------------
aaronpuchert wrote:
> @lebedev.ri, I think that's pretty much your case. On my original change, this would have also warned about `scope`, not just `mu`.
I think i'm missing the point here.
I originally reverted this because the diagnostics i was seeing were pretty unambiguously )to me) bogus.
But the only test change since then ensures that diagnostic is emitted in some case,
there are no tests to ensure it is not emitted in some cases.
So either my revert was wrong, or this still is either issuing seemingly bogus diagnostic,
or lacks test coverage that it doesn't issue said diagnostic.

Which one is it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84604/new/

https://reviews.llvm.org/D84604



More information about the cfe-commits mailing list