diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-02-24 17:13:15 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-02-24 17:13:15 +0000 |
commit | e721185799a59944f4ee3ff9cf367f51c296c70f (patch) | |
tree | d23baf1eef06609139422f1934e8f454ab48556e | |
parent | 016538ad2a69a5f07d07a9dc3031b15ecc2101be (diff) | |
download | bcm5719-llvm-e721185799a59944f4ee3ff9cf367f51c296c70f.tar.gz bcm5719-llvm-e721185799a59944f4ee3ff9cf367f51c296c70f.zip |
Simplify messages as requested by Chris.
llvm-svn: 126389
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 7 | ||||
-rw-r--r-- | clang/test/Sema/shift.c | 6 | ||||
-rw-r--r-- | clang/test/SemaCXX/shift.cpp | 4 |
3 files changed, 8 insertions, 9 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index d1e127b22bd..20633a8b47f 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -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< diff --git a/clang/test/Sema/shift.c b/clang/test/Sema/shift.c index 63c97fe7b02..df6b1141bdf 100644 --- a/clang/test/Sema/shift.c +++ b/clang/test/Sema/shift.c @@ -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); } diff --git a/clang/test/SemaCXX/shift.cpp b/clang/test/SemaCXX/shift.cpp index c5e50128c94..d5a5bed9ea7 100644 --- a/clang/test/SemaCXX/shift.cpp +++ b/clang/test/SemaCXX/shift.cpp @@ -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() { |