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

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 17:05:31 PDT 2020


aaronpuchert added inline comments.


================
Comment at: clang/test/SemaCXX/warn-thread-safety-negative.cpp:87
+Mutex globalMutex;
+void f() EXCLUSIVE_LOCKS_REQUIRED(!globalMutex);
+
----------------
aaron.ballman wrote:
> Can you add a test that uses `!::globalMutex`? I'd like to verify that lookup rules are honored for naming the mutex, so more complex examples with name hiding would also be useful.
Just noticed that we're in namespace `ScopeTest` here, I'll probably need to move that mutex out first. For name hiding I can just name both mutexes the same, I think.


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