[PATCH] D50403: [clang-format]AlignConsecutiveAssignments

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 29 09:47:58 PDT 2018


owenpan requested changes to this revision.
owenpan added inline comments.
This revision now requires changes to proceed.


================
Comment at: include/clang/Format/Format.h:91-93
+  ///   int ddd += 12;
+  ///   int ee  += 22;
+  ///   int f   += 23;
----------------
These are invalid C++ examples.


================
Comment at: lib/Format/WhitespaceManager.cpp:435-451
+  std::vector<tok::TokenKind> assignment_tokens =
+    {tok::equal, tok::pipeequal, tok::caretequal, tok::percentequal,
+     tok::ampequal, tok::plusequal, tok::minusequal, tok::starequal,
+     tok::slashequal, tok::lesslessequal, tok::greatergreaterequal};
+  for (auto assignment_token : assignment_tokens)
+  {
+    AlignTokens(Style,
----------------
It would be simpler to just use `isOneOf(tok::equal, tok::pipeequal, ...)` here.


Repository:
  rC Clang

https://reviews.llvm.org/D50403





More information about the cfe-commits mailing list