[clang] [clang-format] Fix a bug in annotating binary operator && (PR #138633)

Pierre Jolivet via cfe-commits cfe-commits at lists.llvm.org
Fri May 9 22:08:37 PDT 2025


prj- wrote:

@owenca, I actually think that this introduced a regression that was previously fixed in the nightly snapshot of `clang-format-21`.
With `clang-format-20`:
```
$ cat foo.cpp
template <class F, class... Args>
using invoke_result_t = typename std::result_of<F&& (Args &&...)>::type;
$ clang-format-20 foo.cpp
template <class F, class... Args>
using invoke_result_t = typename std::result_of<F&& (Args &&...)>::type;
```
With `clang-format-21` prior to `++20250509052510+a6385a87a2e5-1~exp1~20250509172712.2830`, e.g., `++20250501111520%2B21aa7b8138a1-1\~exp1\~20250501111702.2812`:
```
$ clang-format-21 foo.cpp
template <class F, class... Args>
using invoke_result_t = typename std::result_of<F &&(Args &&...)>::type;
```
But now, we are back to the wrong formatting of `clang-format-20`.

https://github.com/llvm/llvm-project/pull/138633


More information about the cfe-commits mailing list