Before:
const char *test[] = {
// A
"aaaa",
// B
"aaaaa",
};
After:
const char *test[] = {
// A
"aaaa",
// B
"aaaaa",
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174549
91177308-0d34-0410-b5e6-
96231b3b80d8
Comments.back().Tok = Tok.FormatTok;
Comments.back().Spaces = Spaces;
Comments.back().NewLines = NewLines;
- Comments.back().MinColumn = WhitespaceStartColumn + Spaces;
+ if (NewLines == 0)
+ Comments.back().MinColumn = WhitespaceStartColumn + Spaces;
+ else
+ Comments.back().MinColumn = Spaces;
Comments.back().MaxColumn =
Style.ColumnLimit - Spaces - Tok.FormatTok.TokenLength;
return;
" parameter));");
verifyGoogleFormat("#endif // HEADER_GUARD");
+
+ verifyFormat("const char *test[] = {\n"
+ " // A\n"
+ " \"aaaa\",\n"
+ " // B\n"
+ " \"aaaaa\",\n"
+ "};");
}
TEST_F(FormatTest, UnderstandsMultiLineComments) {