[clang-format] Correctly recognize binary operators in template arguments with parent...
authorMarek Kurdej <marek.kurdej+llvm.org@gmail.com>
Wed, 16 Mar 2022 20:50:26 +0000 (21:50 +0100)
committerMarek Kurdej <marek.kurdej+llvm.org@gmail.com>
Thu, 17 Mar 2022 08:36:25 +0000 (09:36 +0100)
commitdc142ea184a526fb2879f84c4c82fff195d36b9d
tree5c26eea6db1eadd666435c12bb22331869ab3b6b
parente2a1f8ec27b88be670cd867c43588f24516d2bbf
[clang-format] Correctly recognize binary operators in template arguments with parenthesized literals.

Fixes https://github.com/llvm/llvm-project/issues/24602.

Before, code like `foo<b & 1>` was formatted correctly but `foo<b & (1)>` wasn't.
This patch fixes this inconsistency.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D121846
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp