]> granicus.if.org Git - clang/commitdiff
Improve diagnostic per Richard's suggestion
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 11 Jan 2013 19:33:54 +0000 (19:33 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 11 Jan 2013 19:33:54 +0000 (19:33 +0000)
(which may yet change if we move the diagnostic
 outside case value).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172242 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/Sema/switch-1.c

index 6712f20cd3597e3828d4e4a44756643541de1c08..0b1917a46d28d5ae4ff483ecc95e5282c1ac2271 100644 (file)
@@ -5713,7 +5713,7 @@ def warn_case_value_overflow : Warning<
   "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<
index 2b729ac0ad31f38317077bc1809ca0967f60cc35..e029bc9ffbfedb6c9ececcaed74e97df5d371c6f 100644 (file)
@@ -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;