[PATCH] D27651: [clang-format] Even with AlignConsecutiveDeclarations, PointerAlignment: Right should keep *s and &s to the right

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 14:10:41 PST 2017


djasper accepted this revision.
djasper added a comment.

Just some nits. Thanks for working on this!



================
Comment at: lib/Format/WhitespaceManager.cpp:158
 
+static bool IsPointerOrReference(tok::TokenKind Kind) {
+  return Kind == tok::star || Kind == tok::amp || Kind == tok::ampamp;
----------------
This should be isPointerOrReference according to the coding guidelines.


================
Comment at: lib/Format/WhitespaceManager.cpp:197
+      for (int previous = i - 1;
+           previous >= 0 && IsPointerOrReference(Changes[previous].Kind);
+           previous--) {
----------------
This really makes me wonder if it wouldn't be much better to just attach the FormatTokens to the changes so we don't have to reimplement more and more of that. But that's probably for a follow up change.


https://reviews.llvm.org/D27651





More information about the cfe-commits mailing list