[clang-tidy] fix buildbots from hicpp-signed-bitwise
authorJonas Toth <jonas.toth@gmail.com>
Wed, 11 Apr 2018 10:22:25 +0000 (10:22 +0000)
committerJonas Toth <jonas.toth@gmail.com>
Wed, 11 Apr 2018 10:22:25 +0000 (10:22 +0000)
The applied patch to diagnose assignment operators introduced
breakage on some architectures. This patch tries to rectify that.

llvm-svn: 329790

clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp

index 5b7f4e5..c85fe20 100644 (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;