forked from OSchip/llvm-project
clang-format: Fix bug in wrapping behavior of operators.
Before (even violating the column limit): auto Diag = diag() << aaaaaaaaaaaaaaaa(aaaaaaaaaaaa, aaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaa); After: auto Diag = diag() << aaaaaaaaaaaaaaaa(aaaaaaaaaaaa, aaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 297931
This commit is contained in:
parent
84319bfc40
commit
04bbda9923
|
@ -915,6 +915,7 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
|
|||
I != E; ++I) {
|
||||
ParenState NewParenState = State.Stack.back();
|
||||
NewParenState.ContainsLineBreak = false;
|
||||
NewParenState.LastOperatorWrapped = true;
|
||||
NewParenState.NoLineBreak =
|
||||
NewParenState.NoLineBreak || State.Stack.back().NoLineBreakInOperand;
|
||||
|
||||
|
|
|
@ -4132,6 +4132,9 @@ TEST_F(FormatTest, AlignsPipes) {
|
|||
verifyFormat(
|
||||
"llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
|
||||
verifyFormat(
|
||||
"auto Diag = diag() << aaaaaaaaaaaaaaaa(aaaaaaaaaaaa, aaaaaaaaaaaaa,\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaaaaa);");
|
||||
|
||||
verifyFormat("llvm::outs() << \"aaaaaaaaaaaaaaaa: \"\n"
|
||||
" << aaaaaaaa.aaaaaaaaaaaa(aaa)->aaaaaaaaaaaaaa();");
|
||||
|
|
Loading…
Reference in New Issue