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 | 5fa05cb906e9ddd34ef2ae2a872014aeaf4bc04d (patch) | |
tree | d205180a95baacd8b766f9dc275aa8992e4e1ac6 | |
parent | f8291a190cc6765630312911f441d9e23564eda2 (diff) |
Simplify messages as requested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126389 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 7 | ||||
-rw-r--r-- | test/Sema/shift.c | 6 | ||||
-rw-r--r-- | test/SemaCXX/shift.cpp | 4 |
3 files changed, 8 insertions, 9 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index d1e127b22b..20633a8b47 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/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/test/Sema/shift.c b/test/Sema/shift.c index 63c97fe7b0..df6b1141bd 100644 --- a/test/Sema/shift.c +++ b/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/test/SemaCXX/shift.cpp b/test/SemaCXX/shift.cpp index c5e50128c9..d5a5bed9ea 100644 --- a/test/SemaCXX/shift.cpp +++ b/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() { |