[clang-format] Add a space between an overloaded operator and '>'
authorOwen Pan <owenpiano@gmail.com>
Fri, 10 Feb 2023 16:50:49 +0000 (08:50 -0800)
committerOwen Pan <owenpiano@gmail.com>
Fri, 17 Feb 2023 04:25:39 +0000 (20:25 -0800)
commitb05dc1b8766a47482cae432011fd2faa04c83a3e
tree31be7949a4caf821797e14198e980af54a24df57
parent7c9df7743521d21d4e03593f4501c5fd7a61c682
[clang-format] Add a space between an overloaded operator and '>'

The token annotator doesn't annotate the template opener and closer
as such if they enclose an overloaded operator. This causes the
space between the operator and the closer to be removed, resulting
in invalid C++ code.

Fixes #58602.

Differential Revision: https://reviews.llvm.org/D143755
clang/lib/Format/FormatToken.h
clang/lib/Format/FormatTokenLexer.cpp
clang/lib/Format/FormatTokenLexer.h
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/TokenAnnotatorTest.cpp