aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Format/Format.cpp2
-rw-r--r--unittests/Format/FormatTest.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index e5e59f4550..fbcb228fbe 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -315,7 +315,7 @@ private:
WhitespaceStartColumn);
}
- State.LastSpace[ParenLevel] = State.Indent[ParenLevel];
+ State.LastSpace[ParenLevel] = State.Column;
if (Current.is(tok::colon) && CurrentLineType != LT_ObjCMethodDecl &&
State.NextToken->Type != TT_ConditionalExpr)
State.Indent[ParenLevel] += 2;
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index fb21ea7c6f..56d4e17468 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -869,6 +869,9 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) {
"aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa,\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaa,\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
+ verifyFormat("template <typename T>\n"
+ "void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
+ " int aaaaaaaaaaaaaaaaa);");
}