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)
This commit is contained in:
Nico 2021-10-19 16:52:57 +00:00 committed by Rasmus Munk Larsen
parent 962a596d21
commit 71320af66a

View File

@ -78,14 +78,14 @@ template <typename HL, typename LL, typename HR, typename LR>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
bool operator == (const TensorUInt128<HL, LL>& lhs, const TensorUInt128<HR, LR>& rhs)
{
return (lhs.high == rhs.high) & (lhs.low == rhs.low);
return (lhs.high == rhs.high) && (lhs.low == rhs.low);
}
template <typename HL, typename LL, typename HR, typename LR>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
bool operator != (const TensorUInt128<HL, LL>& lhs, const TensorUInt128<HR, LR>& rhs)
{
return (lhs.high != rhs.high) | (lhs.low != rhs.low);
return (lhs.high != rhs.high) || (lhs.low != rhs.low);
}
template <typename HL, typename LL, typename HR, typename LR>