clang-format: Fix corner case in builder-type calls.
Before: aaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaaaa()->aaaaaaaaaaaaaae( 0)->aaaaaaaaaaaaaaa(); After: aaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaaaa() ->aaaaaaaaaaaaaae(0) ->aaaaaaaaaaaaaaa(); llvm-svn: 189655
This commit is contained in:
parent
48a5d69ee1
commit
f8151e9bc1
|
@ -187,7 +187,9 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
|
|||
State.ParenLevel == 0)
|
||||
return true;
|
||||
if (startsSegmentOfBuilderTypeCall(Current) &&
|
||||
State.Stack.back().CallContinuation != 0)
|
||||
(State.Stack.back().CallContinuation != 0 ||
|
||||
(State.Stack.back().BreakBeforeParameter &&
|
||||
State.Stack.back().ContainsUnwrappedBuilder)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2890,6 +2890,9 @@ TEST_F(FormatTest, FormatsBuilderPattern) {
|
|||
verifyFormat("aaaaaaaaaaaaaaa.aaaaaaaaaaaaaaa()\n"
|
||||
" .aaaaaaaaaaaaaaa.aaaaaaaaaaaaaaa()\n"
|
||||
" .aaaaaaaaaaaaaaa();");
|
||||
verifyFormat("aaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaaaa()\n"
|
||||
" ->aaaaaaaaaaaaaae(0)\n"
|
||||
" ->aaaaaaaaaaaaaaa();");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, BreaksAccordingToOperatorPrecedence) {
|
||||
|
|
Loading…
Reference in New Issue