Before:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa,
aaaaa);
After:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa, aaaaa);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288119
91177308-0d34-0410-b5e6-
96231b3b80d8
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;
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) {