[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 20 07:28:27 PST 2023


aaronpuchert wrote:

@gendalph, this warning is meant to always warn if a {{default}} label is missing, even if all enumeration values are covered. If you don't want a warning on enumerations, use the previously mentioned clang-tidy check [bugprone-switch-missing-default-case](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/switch-missing-default-case.html). We can probably discuss adding this as warning, though I doubt we'll get consensus on that. This warning was added despite never going to be always-on because GCC has it (under the same name) and some code styles ask for it.

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


More information about the cfe-commits mailing list