[clang-tidy] fix buildbots from hicpp-signed-bitwise

The applied patch to diagnose assignment operators introduced
breakage on some architectures. This patch tries to rectify that.

llvm-svn: 329790
This commit is contained in:
Jonas Toth 2018-04-11 10:22:25 +00:00
parent 0f5f41df93
commit 057f5a1259
1 changed files with 10 additions and 5 deletions

View File

@ -93,11 +93,16 @@ void still_forbidden() {
// Staying within the allowed standard types is ok for bitwise assignment
// operations.
std::ctype_base::mask var = std::ctype_base::mask::print;
var<<= std::ctype_base::mask::upper;
var>>= std::ctype_base::mask::upper;
var &= std::ctype_base::mask::upper;
var |= std::ctype_base::mask::upper;
var ^= std::ctype_base::mask::upper;
SResult<<= std::ctype_base::mask::upper;
// CHECK-MESSAGES: [[@LINE-1]]:13: warning: use of a signed integer operand with a binary bitwise operator
SResult>>= std::ctype_base::mask::upper;
// CHECK-MESSAGES: [[@LINE-1]]:13: warning: use of a signed integer operand with a binary bitwise operator
SResult &= std::ctype_base::mask::upper;
// CHECK-MESSAGES: [[@LINE-1]]:13: warning: use of a signed integer operand with a binary bitwise operator
SResult |= std::ctype_base::mask::upper;
// CHECK-MESSAGES: [[@LINE-1]]:13: warning: use of a signed integer operand with a binary bitwise operator
SResult ^= std::ctype_base::mask::upper;
// CHECK-MESSAGES: [[@LINE-1]]:13: warning: use of a signed integer operand with a binary bitwise operator
UResult = std::locale::category::collate << 1u;
UResult = std::locale::category::ctype << 1;