[cfe-commits] r172242 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/switch-1.c

Fariborz Jahanian fjahanian at apple.com
Fri Jan 11 11:33:54 PST 2013


Author: fjahanian
Date: Fri Jan 11 13:33:54 2013
New Revision: 172242

URL: http://llvm.org/viewvc/llvm-project?rev=172242&view=rev
Log:
Improve diagnostic per Richard's suggestion
(which may yet change if we move the diagnostic
 outside case value).

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/Sema/switch-1.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=172242&r1=172241&r2=172242&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Jan 11 13:33:54 2013
@@ -5713,7 +5713,7 @@
   "overflow converting case value to switch condition type (%0 to %1)">,
   InGroup<Switch>;
 def warn_case_constant_overflow : Warning<
-  "overflow in case constant expression results in new value (%0)">,
+  "overflow in case constant expression results in value %0">,
   InGroup<Switch>;
 def err_duplicate_case : Error<"duplicate case value '%0'">;
 def err_duplicate_case_differing_expr : Error<

Modified: cfe/trunk/test/Sema/switch-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/switch-1.c?rev=172242&r1=172241&r2=172242&view=diff
==============================================================================
--- cfe/trunk/test/Sema/switch-1.c (original)
+++ cfe/trunk/test/Sema/switch-1.c Fri Jan 11 13:33:54 2013
@@ -5,10 +5,10 @@
 int f(int i) {
   switch (i) {
     case 2147483647 + 2: // expected-note {{value 2147483649 is outside the range of representable values of type 'int'}}  \
-                      // expected-warning {{overflow in case constant expression results in new value (-2147483647)}} 
+                      // expected-warning {{overflow in case constant expression results in value -2147483647}} 
       return 1;
     case 9223372036854775807L * 4 : // expected-note {{value 36893488147419103228 is outside the range of representable values of type 'long'}}   \
-                        // expected-warning {{overflow in case constant expression results in new value (-4)}} 
+                        // expected-warning {{overflow in case constant expression results in value -4}} 
       return 2;
     case 2147483647:
       return 0;





More information about the cfe-commits mailing list