[PATCH] D50110: Handle shared release attributes correctly

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 3 07:19:56 PDT 2018

aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.


Comment at: test/SemaCXX/warn-thread-safety-analysis.cpp:4081-4085
+  void unlockExclusive() EXCLUSIVE_UNLOCK_FUNCTION(mu_) {
+    mu_.Unlock();
+  }
+  void unlockShared() SHARED_UNLOCK_FUNCTION(mu_) {
aaronpuchert wrote:
> aaron.ballman wrote:
> > Nothing calls either of these functions within the test; is that intended?
> Yes, I just wanted to check that there are no warnings within the functions. Before the changes in `lib/Analysis/ThreadSafety.cpp`, we would get a warning "releasing mutex 'mu' using shared access, expected exclusive access" on line 4086.
> My changes address the attributes on the function being analyzed, not on a function that is called from the function being analyzed.
Ah, okay, thank you for the explanation. I wasn't aware that was previously failing, so I didn't see the behavioral change.

  rC Clang


More information about the cfe-commits mailing list