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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 09:10:37 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;
----------------
AaronBallman wrote:

Why is this diagnostic off by default? It seems like this is a case users wouldn't want the attribute to be silently ignored.

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


More information about the cfe-commits mailing list