Skip to content
  1. Jan 24, 2012
  2. Jan 23, 2012
  3. Jan 22, 2012
  4. Jan 21, 2012
    • David Blaikie's avatar
      Add -Wswitch-enum-redundant-default. · 645ae0ce
      David Blaikie authored
      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
      645ae0ce
Loading