[clang][SourceManager] Fix -Wparentheses warning (NFC)

GCC warning:
```
/llvm-project/clang/lib/Basic/SourceManager.cpp: In instantiation of ‘constexpr T likelyhasbetween(T, unsigned char, unsigned char) [with T = long unsigned int]’:
/llvm-project/clang/lib/Basic/SourceManager.cpp:1292:52:   required from here
/llvm-project/clang/lib/Basic/SourceManager.cpp:1264:48: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
 1264 |           (x & ~static_cast<T>(0) / 255 * 127) +
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 1265 |               (~static_cast<T>(0) / 255 * (127 - (m - 1)))) &
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This commit is contained in:
Yang Fan 2021-04-09 10:22:56 +08:00
parent 49c79e3b56
commit ca55f05116
No known key found for this signature in database
GPG Key ID: 717E4EB972E515EF

View File

@ -1261,8 +1261,8 @@ template <class T>
static constexpr inline T likelyhasbetween(T x, unsigned char m,
unsigned char n) {
return ((x - ~static_cast<T>(0) / 255 * (n + 1)) & ~x &
(x & ~static_cast<T>(0) / 255 * 127) +
(~static_cast<T>(0) / 255 * (127 - (m - 1)))) &
((x & ~static_cast<T>(0) / 255 * 127) +
(~static_cast<T>(0) / 255 * (127 - (m - 1))))) &
~static_cast<T>(0) / 255 * 128;
}