Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>, Timm =?utf-8?q?Bäder?= <tbae...@redhat.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/67...@github.com>
tbaederr wrote: Updated the branch. This now warns: ```c++ #define LOCKABLE __attribute__ ((lockable)) #define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__ ((exclusive_locks_required(__VA_ARGS__))) struct LOCKABLE Mutex {}; struct Mutex mu1; struct Mutex mu2; int Foo_fun1(int i) // EXCLUSIVE_LOCKS_REQUIRED(mu2) ; void callsFoo() { int a = 10; Foo_fun1(a); } int Foo_fun1(int i) EXCLUSIVE_LOCKS_REQUIRED(mu1) { return i; } ``` ```console ./array.cpp:33:5: warning: attribute mismatch between function declarations of 'Foo_fun1' [-Wthread-safety-attributes] 33 | int Foo_fun1(int i) | ^ 1 warning generated. ``` I started collecting the attribute arguments in a `std::set`, but didn't really end up using them in the end, at least not yet. https://github.com/llvm/llvm-project/pull/67520 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits