Open asl opened 5 years ago
Date: 2019-10-27 10:17:29 -0700 From: @adrianimboden
$ cat main.cpp #includestatic std::mutex guard; int main() { const auto lock = std::scoped_lock{guard}; } $ clang++ -std=c++17 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wthread-safety main.cpp main.cpp:5:57: warning: releasing mutex 'lock' that was not held [-Wthread-safety-analysis] int main() { const auto lock = std::scoped_lock{guard}; } ^ 1 warning generated. when the variable is "auto lock" instead of "const auto lock", then no warning is generated.
This issue was created automatically with bugzilla2github
Bugzilla Bug 3
Date: 2019-10-27T10:17:29+07:00 From: @adrianimboden To: Unassigned Clang Bugs <unassignedclangbugs@nondot.org> CC: llvm-bugs@lists.llvm.org, neeilans@live.com, @zygoloid
Last updated: 2019-10-27T10:17:29+07:00