[PATCH] D33394: [clang-format] Keep trailing preprocessor line comments separate from the following section comments

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 02:12:11 PDT 2017


djasper added inline comments.


================
Comment at: lib/Format/UnwrappedLineParser.cpp:106
+             isLineComment(*Token) && Token->NewlinesBefore == 1 &&
+             Token->OriginalColumn == PreviousToken->OriginalColumn);
   }
----------------
Any chance of moving this logic to distributeComments? I think that's the place we previously tried to encapsulate this logic in. If not, this is fine for now.


================
Comment at: unittests/Format/FormatTestComments.cpp:1030
+               "  int i;\n"
+               "#ifdef A // comment about A\n"
+               "  // section comment 1\n"
----------------
Would it make sense to also add a test case in which the #ifdef comment is actually continued?


https://reviews.llvm.org/D33394





More information about the cfe-commits mailing list