[PATCH] D92257: [clang-format] Add option to control the space at the front of a line comment

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 28 02:20:24 PST 2020


MyDeveloperDay added inline comments.


================
Comment at: clang/docs/ClangFormatStyleOptions.rst:2727
+
+  * ``unsigned Maximum`` The maximum number of spaces at the start of the comment.
+
----------------
I'm personally not a massive fan of stuffing -1 into an unsigned but I understand why its there, if this was an signed and it was actually -1 would the algorithm be substantially worse in your view?


================
Comment at: clang/lib/Format/BreakableToken.cpp:797
+            IndentPrefix
+                .drop_back(SpacesInPrefix - Style.SpacesInLineComments.Maximum)
+                .str();
----------------
my assumption is when Maximum is -1 this is a very large -ve number correct? is that defined behavior for drop_back()


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92257



More information about the cfe-commits mailing list