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<
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);
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);
}
#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() {