[PATCH] D137223: [clang-format] Remove special case for kw_operator when aligning decls

Emilia Dreamer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 4 17:29:41 PDT 2022


rymiel marked 3 inline comments as done.
rymiel added inline comments.


================
Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:441-456
+  Tokens = annotate("int operator+(int);");
+  ASSERT_EQ(Tokens.size(), 8u) << Tokens;
+  EXPECT_TOKEN(Tokens[1], tok::kw_operator, TT_FunctionDeclarationName);
+  EXPECT_TOKEN(Tokens[2], tok::plus, TT_OverloadedOperator);
+  EXPECT_TOKEN(Tokens[3], tok::l_paren, TT_OverloadedOperatorLParen);
+  Tokens = annotate("auto operator=(T&) {}");
+  ASSERT_EQ(Tokens.size(), 10u) << Tokens;
----------------
owenpan wrote:
> Instead of adding new tests, you can add checks for `kw_operator` and `TT_FunctionDeclarationName` to the existing ones.
I wanted to have tests that are declaring operator functions, not just calling them


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137223/new/

https://reviews.llvm.org/D137223



More information about the cfe-commits mailing list