forked from OSchip/llvm-project
clang-format: Fix incorrect line break in certain configurations.
Before: void aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa, vector<int> bbbbbbbbbbbbbbb); After: void aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa, vector<int> bbbbbbbbbbbbbbb); llvm-svn: 257257
This commit is contained in:
parent
804a276fcf
commit
00693b08cf
|
@ -150,7 +150,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
|
|||
if (Previous.is(tok::semi) && State.LineContainsContinuedForLoopSection)
|
||||
return true;
|
||||
if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) ||
|
||||
(Previous.is(TT_TemplateCloser) && Current.is(TT_StartOfName)) ||
|
||||
(Previous.is(TT_TemplateCloser) && Current.is(TT_StartOfName) &&
|
||||
Previous.NestingLevel == 1) ||
|
||||
(Style.BreakBeforeTernaryOperators && Current.is(TT_ConditionalExpr) &&
|
||||
Previous.isNot(tok::question)) ||
|
||||
(!Style.BreakBeforeTernaryOperators &&
|
||||
|
|
|
@ -4062,6 +4062,10 @@ TEST_F(FormatTest, FormatsDeclarationsOnePerLine) {
|
|||
" int aaaaaaaaaaaaaaaaaaaa,\n"
|
||||
" int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}",
|
||||
NoBinPacking);
|
||||
NoBinPacking.AllowAllParametersOfDeclarationOnNextLine = false;
|
||||
verifyFormat("void aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
|
||||
" vector<int> bbbbbbbbbbbbbbb);",
|
||||
NoBinPacking);
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, FormatsOneParameterPerLineIfNecessary) {
|
||||
|
|
Loading…
Reference in New Issue