[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 15:47:29 PDT 2024


https://github.com/aaronpuchert commented:

One more idea for a test: can a parameter attribute reference another parameter? Then we could try something like
```c++
struct ObjectWithMutex { Mutex mu; };
void releaseMember(ObjectWithMutex& object, ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(object.mu));
```
Just to ensure we're parsing the attribute in the right context. My understanding is that the attributes can currently not reference `this` due to the mentioned parser issue, so we can't test that.

https://github.com/llvm/llvm-project/pull/110523


More information about the cfe-commits mailing list