[PATCH] D88239: [clang-format] Fix spaces around */& in multi-variable declarations

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 14:31:24 PDT 2020


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2889
+      return true;
+    return Style.PointerAlignment != FormatStyle::PAS_Left;
   }
----------------
I wish more of these horrendous expressions all over the code were written like this, early exit and with a comment! have an A+



================
Comment at: clang/unittests/Format/FormatTest.cpp:6636
+  verifyFormat("aaaaaaaaa* a = aaaaaaaaaaaaaaaaaaa, * b = bbbbbbbbbbbbbbbbbb,\n"
+               "           * b = bbbbbbbbbbbbbbbbbbb, * d = dddddddddddddddd;",
                Style);
----------------
huh! the original tests doesn't look like LEFT aligned but now we also lose the alignment, should we care I wonder?


================
Comment at: clang/unittests/Format/FormatTest.cpp:6639
   verifyFormat("vector<int*> a, b;", Style);
+  verifyFormat("for (int* p, * q; p != q; p = p->next) {\n}", Style);
+  verifyFormat("char* x, * const* y = NULL;", Style);
----------------
I don't get why `*q` would be `* q`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88239



More information about the cfe-commits mailing list