aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-02-02 08:30:21 +0000
committerDaniel Jasper <djasper@google.com>2017-02-02 08:30:21 +0000
commitc3aa05c01be2661cb3583f47aa7265ec366906e6 (patch)
tree1311b4c0effc9e5d31fc9f60b20adec0df580f7d /clang/lib/Format/ContinuationIndenter.cpp
parent3b008536f3c8d398f4359f4c47e4a9721b11ad08 (diff)
downloadllvm-c3aa05c01be2661cb3583f47aa7265ec366906e6.zip
llvm-c3aa05c01be2661cb3583f47aa7265ec366906e6.tar.gz
llvm-c3aa05c01be2661cb3583f47aa7265ec366906e6.tar.bz2
clang-format: Do not use two-argument/operand special case with no alignment
Without alignment, there is no clean separation between the arguments, even if there are only two. Before: aaaaaaaaaaaaaa( aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaa(aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 293875
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index a7eb82a..3a10065 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -429,7 +429,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
// does not help.
bool HasTwoOperands =
P->OperatorIndex == 0 && !P->NextOperator && !P->is(TT_ConditionalExpr);
- if ((!BreakBeforeOperator && !HasTwoOperands) ||
+ if ((!BreakBeforeOperator && !(HasTwoOperands && Style.AlignOperands)) ||
(!State.Stack.back().LastOperatorWrapped && BreakBeforeOperator))
State.Stack.back().NoLineBreakInOperand = true;
}