[clang] [Sema] Warn about omitting deprecated enumerator in switch (PR #138562)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue May 20 09:57:15 PDT 2025


zmodem wrote:

> Now we have a special Wdeprecated-declarations carveouts for switches, but if you unpack the switch into if / else chain comparisons, you get deprecation warnings.

Agreed, that it is a bit inconsistent. There is prior art though: ba87c626f9b7c48a79673d3fd682c2a1e80a7200 makes exactly the same carve-out for -Wunguarded-availability (though the mechanism is different).

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


More information about the cfe-commits mailing list