unsigned ContinuationIndent =
std::max(State.Stack.back().LastSpace, State.Stack.back().Indent) + 4;
if (Newline) {
+ // Breaking before the first "<<" is generally not desirable if the LHS is
+ // short.
+ if (Current.is(tok::lessless) && State.Stack.back().FirstLessLess == 0 &&
+ State.Column <= Style.ColumnLimit / 2)
+ ExtraPenalty += Style.PenaltyBreakFirstLessLess;
+
State.Stack.back().ContainsLineBreak = true;
if (Current.is(tok::r_brace)) {
if (Current.BlockKind == BK_BracedInit)
State.Stack.back().BreakBeforeParameter = true;
}
- // Breaking before the first "<<" is generally not desirable.
- if (Current.is(tok::lessless) && State.Stack.back().FirstLessLess == 0)
- ExtraPenalty += Style.PenaltyBreakFirstLessLess;
-
} else {
if (Current.is(tok::equal) &&
(RootToken->is(tok::kw_for) || State.ParenLevel == 0) &&
" << aaaaaaaaaaaaaaaaaaaaaaaaaaaa;",
getLLVMStyleWithColumns(70));
- // But sometimes, breaking before the first "<<" is necessary.
+ // But sometimes, breaking before the first "<<" is desirable.
verifyFormat("Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb)\n"
" << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
" << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;");
+ verifyFormat("SemaRef.Diag(Loc, diag::note_for_range_begin_end)\n"
+ " << BEF << IsTemplate << Description << E->getType();");
verifyFormat(
"llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"