[clang] [Clang] [NFC] Introduce helpers for defining compatibilty warnings (PR #132129)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 20 09:45:40 PDT 2025
Sirraide wrote:
> As a followup perhaps, I would LOVE it if we could modify the DiagnosticsEmitter to make the calls here be `CompatDiag(SrcLoc, DiagBASE)`.
>
> WHERE: 1- It determines the C++ standard version itself, so it checks LangOpts so we don't have to actually tell it what standards verseion.
>
> 2- Where the unsigned it takes is actually an index/etc into a decoder. The decoder is just a function that gets generated, so perhaps something like:
That’s an interesting idea: we could use a new set of IDs that get converted to regular diagnostic IDs by the helper and also make it a scoped enum while we’re at it so you can’t confuse the two (because the new IDs would be usable with `CompatDiag` only); the actual diagnostic IDs for the warnings would still be provided (probably in the exact same format that this pr introduces) for cases where you might want to issue one or the other separately (or for when you want to assign it to a variable and pass it around because there are a few cases where we do that because we have a set of more than just 2 compat warnings; this pr doesn’t handle such cases and they are rare enough to where I feel like it’s not worth trying to handle them like this).
I’ll look into this next because I feel like this shouldn’t be all that hard to implement
https://github.com/llvm/llvm-project/pull/132129
More information about the cfe-commits
mailing list