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

Malek Ben Slimane via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 29 10:59:26 PST 2024


================
@@ -3984,6 +3984,10 @@ def warn_thread_attribute_decl_not_lockable : Warning<
 def warn_thread_attribute_decl_not_pointer : Warning<
   "%0 only applies to pointer types; type here is %1">,
   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
+def warn_thread_attribute_not_on_scoped_lockable_param : Warning<
+  "%0 attribute applies to function parameters only if their type is a "
+  "reference to a 'scoped_lockable'-annotated type">,
+  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
----------------
malek203 wrote:

The `DefaultIgnore` setting aligns with the fact that the warnings `-Wthread-safety-analysis` and `-Wthread-safety-attributes` are not enabled by default.

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


More information about the cfe-commits mailing list