Before:
f(FirstToken->WhitespaceRange.getBegin().getLocWithOffset(
First->LastNewlineOffset));
After:
f(FirstToken->WhitespaceRange.getBegin()
.getLocWithOffset(First->LastNewlineOffset));
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216377
91177308-0d34-0410-b5e6-
96231b3b80d8
getColumnLimit(State))
BreakBeforeParameter = true;
}
- bool NoLineBreak = State.Stack.back().NoLineBreak ||
- (Current.Type == TT_TemplateOpener &&
- State.Stack.back().ContainsUnwrappedBuilder);
+ bool NoLineBreak =
+ State.Stack.back().NoLineBreak ||
+ ((Current.NestingLevel != 0 || Current.Type == TT_TemplateOpener) &&
+ State.Stack.back().ContainsUnwrappedBuilder);
State.Stack.push_back(ParenState(NewIndent, NewIndentLevel,
State.Stack.back().LastSpace,
AvoidBinPacking, NoLineBreak));
" .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>();");
- // Prefer not to break after empty parentheses.
+ // Prefer not to break after empty parentheses ...
verifyFormat("FirstToken->WhitespaceRange.getBegin().getLocWithOffset(\n"
" First->LastNewlineOffset);");
+ // ... unless nested.
+ verifyFormat("f(FirstToken->WhitespaceRange.getBegin()\n"
+ " .getLocWithOffset(First->LastNewlineOffset));");
}
TEST_F(FormatTest, BreaksAccordingToOperatorPrecedence) {