forked from OSchip/llvm-project
clang-format: Fix unnnecessary line break.
Before: aaaaaaaaaa(aaaa(aaaa, aaaa), // aaaa, aaaaa); After: aaaaaaaaaa(aaaa(aaaa, aaaa), // aaaa, aaaaa); llvm-svn: 288119
This commit is contained in:
parent
65abfb1102
commit
35e4122f48
|
@ -523,7 +523,8 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
|
|||
Style.ContinuationIndentWidth;
|
||||
}
|
||||
|
||||
if ((Previous.isOneOf(tok::comma, tok::semi) &&
|
||||
if ((PreviousNonComment &&
|
||||
PreviousNonComment->isOneOf(tok::comma, tok::semi) &&
|
||||
!State.Stack.back().AvoidBinPacking) ||
|
||||
Previous.is(TT_BinaryOperator))
|
||||
State.Stack.back().BreakBeforeParameter = false;
|
||||
|
|
|
@ -1137,6 +1137,12 @@ TEST_F(FormatTest, KeepsParameterWithTrailingCommentsOnTheirOwnLine) {
|
|||
format("SomeFunction(a, // comment\n"
|
||||
" b,\n"
|
||||
" c); // comment"));
|
||||
EXPECT_EQ("aaaaaaaaaa(aaaa(aaaa,\n"
|
||||
" aaaa), //\n"
|
||||
" aaaa, bbbbb);",
|
||||
format("aaaaaaaaaa(aaaa(aaaa,\n"
|
||||
"aaaa), //\n"
|
||||
"aaaa, bbbbb);"));
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, RemovesTrailingWhitespaceOfComments) {
|
||||
|
|
Loading…
Reference in New Issue