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

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 7 08:53:37 PDT 2023


aaronpuchert wrote:

Yeah, it's a tricky question. On one hand there have been previous issues like #42194 (which this would basically address), and it would definitely improve consistency and prevent beginner's mistakes. On the other hand it seems useful to allow adding attributes e.g. to third-party libraries where you don't control the headers.

Perhaps we should introduce such checks, but put them under a subflag of `-Wthread-safety-attributes` to allow opting out of them (even locally via pragmas). And of course it should apply more or less to every thread safety annotation, not just `requires_capability`.

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


More information about the cfe-commits mailing list