[PATCH] D36614: [clang-format] Refine trailing comment detection

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 22 05:12:14 PDT 2017

krasimir marked an inline comment as done.
krasimir added inline comments.

Comment at: lib/Format/FormatToken.h:397
+             (!Previous ||
+              Previous->isOneOf(tok::comma, tok::equal, tok::l_brace) ||
+              Next->is(tok::r_brace))));
djasper wrote:
> Is this list coming from existing tests?

Comment at: unittests/Format/FormatTestComments.cpp:461
+  verifyFormat("const /** comment comment comment comment */\n"
+               "    A = B;",
djasper wrote:
> I wonder whether instead we should just break the comment here, even if it is not a trailing one. Violating the column limit also seems bad. What happens if we do that (i.e. break non-trailing comments)?
Thanks! I've tried this approach here: https://reviews.llvm.org/D37007


More information about the cfe-commits mailing list