[PATCH] Fixes incorrect indentation of line comments after break and re-alignment.

Manuel Klimek klimek at google.com
Mon Jun 17 05:36:33 PDT 2013


  lg


================
Comment at: lib/Format/WhitespaceManager.cpp:71
@@ -70,2 +70,3 @@
       // correctly store a tok::TokenKind instead of rolling our own enum.
-      tok::unknown, InPPDirective && !Tok.IsFirst));
+      Tok.Type == TT_LineComment && Newlines > 0 ? tok::comment : tok::unknown,
+      InPPDirective && !Tok.IsFirst));
----------------
Alexander Kornienko wrote:
> Manuel Klimek wrote:
> > Why does Newlines > 0 make a difference here?
> This should be tok::comment only if we create the new comment. Currently in case Newlines == 0 we're just inserting one space, no new comment is created.
Makes sense, please add a comment :)


http://llvm-reviews.chandlerc.com/D980

BRANCH
  svn

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list