From 057f5a12594a26f9f2fd6d69446df517e14ec52f Mon Sep 17 00:00:00 2001 From: Jonas Toth Date: Wed, 11 Apr 2018 10:22:25 +0000 Subject: [PATCH] [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 --- .../clang-tidy/hicpp-signed-bitwise-standard-types.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp b/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp index 5b7f4e5..c85fe20 100644 --- a/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp +++ b/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp @@ -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; -- 2.7.4