[cfe-commits] r126389 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/shift.c test/SemaCXX/shift.cpp
Chandler Carruth
chandlerc at gmail.com
Thu Feb 24 09:13:15 PST 2011
Author: chandlerc
Date: Thu Feb 24 11:13:15 2011
New Revision: 126389
URL: http://llvm.org/viewvc/llvm-project?rev=126389&view=rev
Log:
Simplify messages as requested by Chris.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/Sema/shift.c
cfe/trunk/test/SemaCXX/shift.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=126389&r1=126388&r2=126389&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Feb 24 11:13:15 2011
@@ -2341,12 +2341,11 @@
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<
Modified: cfe/trunk/test/Sema/shift.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/shift.c?rev=126389&r1=126388&r2=126389&view=diff
==============================================================================
--- cfe/trunk/test/Sema/shift.c (original)
+++ cfe/trunk/test/Sema/shift.c Thu Feb 24 11:13:15 2011
@@ -37,8 +37,8 @@
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 @@
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);
}
Modified: cfe/trunk/test/SemaCXX/shift.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/shift.cpp?rev=126389&r1=126388&r2=126389&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/shift.cpp (original)
+++ cfe/trunk/test/SemaCXX/shift.cpp Thu Feb 24 11:13:15 2011
@@ -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() {
More information about the cfe-commits
mailing list