cor3ntin wrote:

I'd like other to weight in on that but even though GCC has that flag (which 
clang recognizes and ignores), I'm, a bit reluctant to add a warning for it.
We have a policy to avoid off-by-default warnings most of the time... but more 
importantly, whether switch statements
should have a default is not something the industry seem to agree on, so it 
would be a very opinionated warning.

For example, Folks at google advise against using `default` when switching over 
an enum https://abseil.io/tips/147.
Misra requires a default statement, but makes an exception for enums. (6.4.6 in 
misra 2008)

LLVM development heavily relies on `-Wswitch-enum`, for example.

Maybe the existing tidy check is the right tool for this.
 

https://github.com/llvm/llvm-project/pull/73077
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to