[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 08:58:58 PST 2024


================
@@ -2249,7 +2249,7 @@ void fooF1(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_) {
   f->a = 1;
 }
 
-void fooF2(Foo *f);
+void fooF2(Foo *f); // expected-warning {{attribute mismatch between function declarations of 'fooF2'}}
 void fooF2(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_) {
----------------
aaronpuchert wrote:

That sounds strange because usually notes point to previous source locations. I think it makes sense to find out why it doesn't work here.

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


More information about the cfe-commits mailing list