aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Format/Format.cpp7
-rw-r--r--unittests/Format/FormatTest.cpp5
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 2952067c39..9b6067c37b 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -596,12 +596,9 @@ private:
Current.isNot(tok::comment))
State.Stack[ParenLevel].HasMultiParameterLine = true;
-
- // Top-level spaces that are not part of assignments are exempt as that
- // mostly leads to better results.
+ // Top-level spaces are exempt as that mostly leads to better results.
State.Column += Spaces;
- if (Spaces > 0 &&
- (ParenLevel != 0 || getPrecedence(Previous) == prec::Assignment))
+ if (Spaces > 0 && ParenLevel != 0)
State.Stack[ParenLevel].LastSpace = State.Column;
}
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 708b7d8086..493f2ad7b2 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1040,9 +1040,8 @@ TEST_F(FormatTest, BreaksAfterAssignments) {
" TTI.getMemoryOpCost(I->getOpcode(), VectorTy, SI->getAlignment(),\n"
" SI->getPointerAddressSpaceee());\n");
verifyFormat(
- "CharSourceRange LineRange =\n"
- " CharSourceRange::getTokenRange(Line.Tokens.front().Tok.getLoc(),\n"
- " Line.Tokens.back().Tok.getLoc());");
+ "CharSourceRange LineRange = CharSourceRange::getTokenRange(\n"
+ " Line.Tokens.front().Tok.getLo(), Line.Tokens.back().Tok.getLoc());");
}
TEST_F(FormatTest, AlignsAfterAssignments) {