[PATCH] D103245: [clang-format] Fix PointerAlignmentRight with AlignConsecutiveDeclarations

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 28 13:03:56 PDT 2021


curdeius added a comment.

Seems really nice. Just some nits & question.
Thanks for resuscitating the other review!

Please mention https://llvm.org/PR27353 in the description and update it after landing.



================
Comment at: clang/lib/Format/WhitespaceManager.cpp:379
+        Changes[i].Spaces != 0) {
+      for (int previous = i - 1;
+           previous >= 0 &&
----------------
Nit: `previous` -> `Previous`. Or `PreviousIndex`?


================
Comment at: clang/unittests/Format/FormatTest.cpp:15044
+
+  // PAS_RIGHT
   EXPECT_EQ("void SomeFunction(int parameter = 0) {\n"
----------------
Nit: please match the case with the option, i.e. `PAS_Right`.


================
Comment at: clang/unittests/Format/FormatTest.cpp:15068
                    Alignment));
+  EXPECT_EQ("void SomeFunction(int parameter = 0) {\n"
+            "  int const i   = 1;\n"
----------------
Is there a reason why we don't use `verifyFormat` in these tests?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103245



More information about the cfe-commits mailing list