Thread safety analysis: Allow scoped releasing of capabilities
authorAaron Puchert <aaronpuchert@alice-dsl.net>
Sun, 16 Dec 2018 14:15:30 +0000 (14:15 +0000)
committerAaron Puchert <aaronpuchert@alice-dsl.net>
Sun, 16 Dec 2018 14:15:30 +0000 (14:15 +0000)
commit6a68efc959bd1024506bf661a9e155de8a8440da
tree966164208d4ab55226d231bf15e830dca3d0b3b2
parent7d648f86b0536696868d4b6a594b900957d6dbd8
Thread safety analysis: Allow scoped releasing of capabilities

Summary:
The pattern is problematic with C++ exceptions, and not as widespread as
scoped locks, but it's still used by some, for example Chromium.

We are a bit stricter here at join points, patterns that are allowed for
scoped locks aren't allowed here. That could still be changed in the
future, but I'd argue we should only relax this if people ask for it.

Fixes PR36162.

Reviewers: aaron.ballman, delesley, pwnall

Reviewed By: delesley, pwnall

Subscribers: pwnall, cfe-commits

Differential Revision: https://reviews.llvm.org/D52578

llvm-svn: 349300
clang/lib/Analysis/ThreadSafety.cpp
clang/test/SemaCXX/warn-thread-safety-analysis.cpp