From 71320af66a2401cf7d843de9b785655014a5e261 Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 19 Oct 2021 16:52:57 +0000 Subject: [PATCH] Fix -Wbitwise-instead-of-logical clang warning & and | short-circuit, && and || don't. When both arguments to those are boolean, the short-circuiting version is usually the desired one, so clang warns on this. Here, it is inconsequential, so switch to && and || to suppress the warning. (cherry picked from commit b17bcddbca749f621040990a3efb840046315050) --- unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h b/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h index d23f2e4c8..afbcba4a2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h @@ -78,14 +78,14 @@ template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool operator == (const TensorUInt128& lhs, const TensorUInt128& rhs) { - return (lhs.high == rhs.high) & (lhs.low == rhs.low); + return (lhs.high == rhs.high) && (lhs.low == rhs.low); } template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool operator != (const TensorUInt128& lhs, const TensorUInt128& rhs) { - return (lhs.high != rhs.high) | (lhs.low != rhs.low); + return (lhs.high != rhs.high) || (lhs.low != rhs.low); } template