1 // RUN: %clang_cc1 -std=c++11 %s -verify -Wthread-safety-analysis
5 void Lock() __attribute__((exclusive_lock_function()));
6 void Unlock() __attribute__((unlock_function()));
13 void foo() __attribute__((exclusive_locks_required(mu1
))) __attribute__((exclusive_locks_required(mu2
))) {}
15 template <class T
> void bar() __attribute__((exclusive_locks_required(mu1
))) __attribute__((exclusive_locks_required(mu2
))) {
26 a
.bar
<int>(); // expected-warning {{calling function 'bar<int>' requires holding mutex 'a.mu2' exclusively}}
28 a
.bar
<int>(); // expected-warning {{calling function 'bar<int>' requires holding mutex 'a.mu1' exclusively}} \
29 expected
-warning
{{calling function
'bar<int>' requires holding mutex
'a.mu2' exclusively
}}