[clang-format] Correctly annotate */&/&& in operator function calls
authorOwen Pan <owenpiano@gmail.com>
Fri, 30 Jun 2023 01:14:18 +0000 (18:14 -0700)
committerOwen Pan <owenpiano@gmail.com>
Tue, 4 Jul 2023 00:49:10 +0000 (17:49 -0700)
commit3f3620e5c9ee0f7b64afc39e5a26c6f4cc5e7b37
tree0eb63a578f194c1b190a992327f61fc65e05b83f
parentcff99b76ac4f502ceba897a62db658667f1237f3
[clang-format] Correctly annotate */&/&& in operator function calls

Reverts 4986f3f2f220 (but keeps its unit tests) and fixes #49973
differently.

Also fixes bugs that incorrectly annotate the operator keyword as
TT_FunctionDeclarationName in function calls and as TT_Unknown in function
declarations and definitions.

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