diff options
author | DeLesley Hutchins <delesley@google.com> | 2012-07-02 22:16:54 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2012-07-02 22:16:54 +0000 |
commit | 6e6dbb76180bf9ee9d45fc5b69eadfa16a54dd6c (patch) | |
tree | 152266425cbb5f47363030191f736d819f023cbb /clang/test/SemaCXX/warn-thread-safety-analysis.cpp | |
parent | 2a15baf9683d29849cbc82c6f972d338927609b8 (diff) | |
download | bcm5719-llvm-6e6dbb76180bf9ee9d45fc5b69eadfa16a54dd6c.tar.gz bcm5719-llvm-6e6dbb76180bf9ee9d45fc5b69eadfa16a54dd6c.zip |
Thread safety analysis: fixed incorrect error message at the end of a locks_required function.
llvm-svn: 159607
Diffstat (limited to 'clang/test/SemaCXX/warn-thread-safety-analysis.cpp')
-rw-r--r-- | clang/test/SemaCXX/warn-thread-safety-analysis.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp index 53f3bee2ac7..35a2dd01214 100644 --- a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp +++ b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp @@ -2451,6 +2451,22 @@ void Foo::foo() EXCLUSIVE_LOCKS_REQUIRED(mu_) { }; +namespace UnlockBug { +class Foo { +public: + Mutex mutex_; + + void foo1() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { // expected-note {{mutex acquired here}} + mutex_.Unlock(); + } // expected-warning {{expecting mutex 'mutex_' to be locked at the end of function}} + + + void foo2() SHARED_LOCKS_REQUIRED(mutex_) { // expected-note {{mutex acquired here}} + mutex_.Unlock(); + } // expected-warning {{expecting mutex 'mutex_' to be locked at the end of function}} +}; + +} // end namespace UnlockBug |