[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / thread-safety.cpp
blobe6e85d284c82015905758d39c3e31ddac1cbc4ce
1 // RUN: rm -rf %t
2 // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps \
3 // RUN: -I%S/Inputs/thread-safety -std=c++11 -Wthread-safety \
4 // RUN: -verify %s
5 //
6 // expected-no-diagnostics
8 #include "b.h"
9 #include "c.h"
11 bool g();
12 void X::f() {
13 m.lock();
14 if (g())
15 m.unlock();
16 else
17 unlock(*this);