[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 5 06:58:12 PDT 2025
================
@@ -4222,6 +4222,11 @@ def warn_fun_requires_lock_precise :
InGroup<ThreadSafetyPrecise>, DefaultIgnore;
def note_found_mutex_near_match : Note<"found near match '%0'">;
+// Pedantic thread safety warnings enabled by default
+def warn_thread_reentrant_with_negative_capability : Warning<
+ "%0 is marked reentrant but used as a negative capability; this may be contradictory">,
+ InGroup<ThreadSafetyPedantic>, DefaultIgnore;
----------------
AaronBallman wrote:
> Introduce a pedantic warning group, which is enabled by default, to warn about using a reentrant capability as a negative capability: this usage is likely contradictory.
The only attribute in the group is marked `DefaultIgnore`, did you mean to drop that?
https://github.com/llvm/llvm-project/pull/141599
More information about the cfe-commits
mailing list