[clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs
authorBjörn Schäpers <bjoern@hazardy.de>
Thu, 24 Feb 2022 14:14:49 +0000 (15:14 +0100)
committerBjörn Schäpers <bjoern@hazardy.de>
Tue, 1 Mar 2022 20:55:32 +0000 (21:55 +0100)
commitd6daca21738aed64837b825c32d4f1b4f54cec04
tree3f2c1ddafdb1faa1722995e2ef4346fc6aeab0ad
parent78ac86701801663d700919e543f4e1129982993d
[clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs

In the presence of pp branches we parse the token stream multiple times.
Thus the token already has the type set. It's best just not to assert on
any type in the parser.

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

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