diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-01-21 18:12:07 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-01-21 18:12:07 +0000 |
commit | 31ceb61172bca7ebc3fb90e9125864c7a29c55c0 (patch) | |
tree | d605bb1e6086fadf6341cc1b65bdf886a5698bdd /lib/Sema/SemaDecl.cpp | |
parent | f3c1ca6bced3f79ec6d76f1bcb05c5ae6944ce0b (diff) |
Add -Wswitch-enum-redundant-default.
This warning acts as the complement to the main -Wswitch-enum warning (which
warns whenever a switch over enum without a default doesn't cover all values of
the enum) & has been an an-doc coding convention in LLVM and Clang in my
experience. The purpose is to ensure there's never a "dead" default in a
switch-over-enum because this would hide future -Wswitch-enum errors.
The name warning has a separate flag name so it can be disabled but it's grouped
under -Wswitch-enum & is on-by-default because of this.
The existing violations of this rule in test cases have had the warning disabled
& I've added a specific test for the new behavior (many negative cases already
exist in the same test file - and none regressed - so I didn't add more).
Reviewed by Ted Kremenek ( http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120116/051690.html )
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
0 files changed, 0 insertions, 0 deletions