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

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 21 23:58:23 PDT 2017

djasper 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))));
Is this list coming from existing tests?

Comment at: unittests/Format/FormatTestComments.cpp:461
+  verifyFormat("const /** comment comment comment comment */\n"
+               "    A = B;",
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)?


More information about the cfe-commits mailing list