We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c86e46 commit 013a6d1Copy full SHA for 013a6d1
clang/test/Analysis/block-in-critical-section-inheritance.cpp
@@ -39,3 +39,17 @@ void no_false_positive_gh_104241() {
39
m.unlock();
40
sleep(10); // no-warning
41
}
42
+
43
+struct TwoMutexes {
44
+ std::mutex m1;
45
+ std::mutex m2;
46
+};
47
48
+void two_mutexes_false_negative(TwoMutexes &tm) {
49
+ tm.m1.lock();
50
+ tm.m2.unlock();
51
+ // Critical section is associated with tm now so tm.m1 and tm.m2 are
52
+ // undistinguishiable
53
+ sleep(10); // False-negative
54
+ tm.m1.unlock();
55
+}
0 commit comments