[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)
Aaron Puchert via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 21 14:08:12 PST 2024
================
@@ -4054,7 +4054,9 @@ def warn_acquired_before : Warning<
def warn_acquired_before_after_cycle : Warning<
"cycle in acquired_before/after dependencies, starting with '%0'">,
InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
-
+def warn_attribute_mismatch : Warning<
+ "attribute mismatch between function declarations of %0">,
----------------
aaronpuchert wrote:
Since attributes are inherited, the mismatch is inherently one-sided. The declaration that we warn on has some attribute that the previous declaration didn't have. So maybe we can be more specific and say something like "thread safety attribute on function declaration is missing on first declaration".
Also, I think we should group it with the other `ThreadSafetyAttributes` warnings.
https://github.com/llvm/llvm-project/pull/67520
More information about the cfe-commits
mailing list