[cfe-commits] r148783 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td test/Sema/switch.c test/Sema/warn-unreachable.c test/SemaCXX/gnu-case-ranges.cpp test/SemaCXX/return-noreturn.cpp

David Blaikie dblaikie at gmail.com
Mon Jan 23 21:34:08 PST 2012


Author: dblaikie
Date: Mon Jan 23 23:34:08 2012
New Revision: 148783

URL: http://llvm.org/viewvc/llvm-project?rev=148783&view=rev
Log:
Reword/rename -Wswitch-unreachable-default.

Rewording the diagnostic to be more precise/correct: "default label in switch
which covers all enumeration values" and changed the switch to
-Wcovered-switch-default

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/Sema/switch.c
    cfe/trunk/test/Sema/warn-unreachable.c
    cfe/trunk/test/SemaCXX/gnu-case-ranges.cpp
    cfe/trunk/test/SemaCXX/return-noreturn.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=148783&r1=148782&r2=148783&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Mon Jan 23 23:34:08 2012
@@ -184,8 +184,8 @@
 def StrictSelector : DiagGroup<"strict-selector-match">;
 def MethodDuplicate : DiagGroup<"duplicate-method-match">;
 def SwitchEnum     : DiagGroup<"switch-enum">;
-def SwitchRedundantDefault : DiagGroup<"switch-redundant-default">;
-def Switch         : DiagGroup<"switch", [SwitchRedundantDefault]>;
+def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
+def Switch         : DiagGroup<"switch", [CoveredSwitchDefault]>;
 def Trigraphs      : DiagGroup<"trigraphs">;
 
 def : DiagGroup<"type-limits">;

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=148783&r1=148782&r2=148783&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Jan 23 23:34:08 2012
@@ -4987,8 +4987,8 @@
   InGroup<Switch>;
 
 def warn_unreachable_default : Warning<
-  "default is unreachable as all enumeration values are accounted for">,
-  InGroup<SwitchRedundantDefault>;
+  "default label in switch which covers all enumeration values">,
+  InGroup<CoveredSwitchDefault>;
 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
   InGroup<Switch>; 
 def err_typecheck_statement_requires_scalar : Error<

Modified: cfe/trunk/test/Sema/switch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/switch.c?rev=148783&r1=148782&r2=148783&view=diff
==============================================================================
--- cfe/trunk/test/Sema/switch.c (original)
+++ cfe/trunk/test/Sema/switch.c Mon Jan 23 23:34:08 2012
@@ -295,6 +295,6 @@
   case A: return 0;
   case B: return 1;
   case 7: return 1; // expected-warning {{case value not in enumerated type}}
-  default: return 2; // expected-warning {{default is unreachable as all enumeration values are accounted for}}
+  default: return 2; // expected-warning {{default label in switch which covers all enumeration values}}
   }
 }

Modified: cfe/trunk/test/Sema/warn-unreachable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-unreachable.c?rev=148783&r1=148782&r2=148783&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-unreachable.c (original)
+++ cfe/trunk/test/Sema/warn-unreachable.c Mon Jan 23 23:34:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-switch-redundant-default
+// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-covered-switch-default
 
 int halt() __attribute__((noreturn));
 int live();

Modified: cfe/trunk/test/SemaCXX/gnu-case-ranges.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/gnu-case-ranges.cpp?rev=148783&r1=148782&r2=148783&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/gnu-case-ranges.cpp (original)
+++ cfe/trunk/test/SemaCXX/gnu-case-ranges.cpp Mon Jan 23 23:34:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -Wno-switch-redundant-default %s
+// RUN: %clang_cc1 -verify -Wno-covered-switch-default %s
 
 enum E {
     one,

Modified: cfe/trunk/test/SemaCXX/return-noreturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/return-noreturn.cpp?rev=148783&r1=148782&r2=148783&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/return-noreturn.cpp (original)
+++ cfe/trunk/test/SemaCXX/return-noreturn.cpp Mon Jan 23 23:34:08 2012
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-switch-redundant-default
-// RUN: %clang_cc1 %s -fsyntax-only -std=c++11 -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-switch-redundant-default
+// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
+// RUN: %clang_cc1 %s -fsyntax-only -std=c++11 -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
 
 // A destructor may be marked noreturn and should still influence the CFG.
 void pr6884_abort() __attribute__((noreturn));





More information about the cfe-commits mailing list