[PATCH] [clang-tidy] Add check for possibly incomplete switch statements

Alexander Kornienko alexfh at google.com
Tue Aug 5 05:14:32 PDT 2014


On Sun, Aug 3, 2014 at 4:55 PM, Benjamin Bannier <bbannier at gmail.com> wrote:

> While clang issues a warns about a possibly incomplete switch statement
> when switching over an enum variable and failing to cover all enum
> values (either explicitly or with a default case), no such warning is
> emitted if a plain integer variable is used as switch variable.
>

If we consider this diagnostic useful, then we should implement
-Wswitch-default in Clang (GCC has it, Clang doesn't).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140805/c76a07c9/attachment.html>


More information about the cfe-commits mailing list