]> granicus.if.org Git - clang/commitdiff
Simplify messages as requested by Chris.
authorChandler Carruth <chandlerc@gmail.com>
Thu, 24 Feb 2011 17:13:15 +0000 (17:13 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 24 Feb 2011 17:13:15 +0000 (17:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126389 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/Sema/shift.c
test/SemaCXX/shift.cpp

index d1e127b22bd60c90ddd3e57c404039f66099e95e..20633a8b47fc2f81a5192ee7d29c19ad6ab4358e 100644 (file)
@@ -2341,12 +2341,11 @@ def warn_remainder_by_zero : Warning<"remainder by zero is undefined">;
 def warn_shift_negative : Warning<"shift count is negative">;
 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">;
 def warn_shift_result_gt_typewidth : Warning<
-  "shift result (%0) requires %1 bits to represent, but the promoted type of "
-  "the shift expression is %2 with only %3 bits">,
+  "shift result (%0) requires %1 bits to represent, but %2 only has %3 bits">,
    InGroup<DiagGroup<"shift-overflow">>;
 def warn_shift_result_overrides_sign_bit : Warning<
-  "shift result (%0) overrides the sign bit of the promoted type of the shift "
-  "expression (%1) and becomes negative">,
+  "shift result (%0) overrides the sign bit of the shift expression's type "
+  "(%1) and becomes negative">,
   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
 
 def warn_precedence_bitwise_rel : Warning<
index 63c97fe7b029b25368828c3d3ecccaad86b07cd1..df6b1141bdfc7c82d81a28efb3daa426662c4dc7 100644 (file)
@@ -37,8 +37,8 @@ void test() {
 
   int i;
   i = 1 << (WORD_BIT - 2);
-  i = 2 << (WORD_BIT - 1); // expected-warning {{the promoted type of the shift expression is 'int'}}
-  i = 1 << (WORD_BIT - 1); // expected-warning {{overrides the sign bit of the promoted type of the shift expression ('int')}}
+  i = 2 << (WORD_BIT - 1); // expected-warning {{bits to represent, but 'int' only has}}
+  i = 1 << (WORD_BIT - 1); // expected-warning {{overrides the sign bit of the shift expression}}
   i = -1 << (WORD_BIT - 1);
   i = 0 << (WORD_BIT - 1);
   i = (char)1 << (WORD_BIT - 2);
@@ -48,7 +48,7 @@ void test() {
   u = 5U << (WORD_BIT - 1);
 
   long long int lli;
-  lli = INT_MIN << 2; // expected-warning {{the promoted type of the shift expression is 'int'}}
+  lli = INT_MIN << 2; // expected-warning {{bits to represent, but 'int' only has}}
   lli = 1LL << (sizeof(long long) * CHAR_BIT - 2);
 }
 
index c5e50128c94204628b39ce7b09dadf71c55df915..d5a5bed9ea7a4ae8fd1976fc0d3a05e9221818c6 100644 (file)
@@ -5,8 +5,8 @@
 #define WORD_BIT (sizeof(int) * CHAR_BIT)
 
 template <int N> void f() {
-  (void)(N << 30); // expected-warning {{the promoted type of the shift expression is 'int'}}
-  (void)(30 << N); // expected-warning {{the promoted type of the shift expression is 'int'}}
+  (void)(N << 30); // expected-warning {{bits to represent, but 'int' only has}}
+  (void)(30 << N); // expected-warning {{bits to represent, but 'int' only has}}
 }
 
 void test() {