[all-commits] [llvm/llvm-project] ca55f0: [clang][SourceManager] Fix -Wparentheses warning (...

nullptr-cpp via All-commits all-commits at lists.llvm.org
Thu Apr 8 19:23:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca55f0511698e5b64538e02eff9f6b2280282b15
      https://github.com/llvm/llvm-project/commit/ca55f0511698e5b64538e02eff9f6b2280282b15
  Author: Yang Fan <nullptr.cpp at gmail.com>
  Date:   2021-04-09 (Fri, 09 Apr 2021)

  Changed paths:
    M clang/lib/Basic/SourceManager.cpp

  Log Message:
  -----------
  [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)))) &
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```




More information about the All-commits mailing list