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 | 645ae0ce10cbbe44383eab948597d3432e23a441 (patch) | |
tree | e9aaa33acf1acf6639ac23ff28dfa3337e2b8095 /clang/test/Sema/warn-unreachable.c | |
parent | fb6ecdf27c40654746780cb92f922655c59db19e (diff) | |
download | bcm5719-llvm-645ae0ce10cbbe44383eab948597d3432e23a441.tar.gz bcm5719-llvm-645ae0ce10cbbe44383eab948597d3432e23a441.zip |
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 )
llvm-svn: 148640
Diffstat (limited to 'clang/test/Sema/warn-unreachable.c')
-rw-r--r-- | clang/test/Sema/warn-unreachable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/warn-unreachable.c b/clang/test/Sema/warn-unreachable.c index 3ad53c707ba..46a680f0ef8 100644 --- a/clang/test/Sema/warn-unreachable.c +++ b/clang/test/Sema/warn-unreachable.c @@ -1,4 +1,4 @@ -// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value +// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-switch-enum-redundant-default int halt() __attribute__((noreturn)); int live(); |