Bug ID: 33504
           Summary: Thread Safety Analysis [-Wthread-safety-analysis] work
                    wrong with shared lock
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer

Created attachment 18656
Example code

When I use -Wthread-safety-analysis flag for code with wrapper for
std::shared_lock I have warning:

main.cpp:110:1: warning: releasing mutex 'lg_shared' using shared access,
expected exclusive access [-Wthread-safety-analysis]

So RELEASE_SHARED() attribute not works with ACQUIRE_SHARED() for scoped
capability. Example code in attachment.

build command:
clang++-4.0 -o main main.cpp -std=c++14 -lboost_system -lboost_thread -pthread

clang++-4.0 -v
clang version 4.0.1-svn305187-1~exp1 (branches/release_40)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to