aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Format/WhitespaceManager.cpp5
-rw-r--r--clang/unittests/Format/FormatTest.cpp7
2 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp
index 762729d..2cbde3d 100644
--- a/clang/lib/Format/WhitespaceManager.cpp
+++ b/clang/lib/Format/WhitespaceManager.cpp
@@ -372,9 +372,10 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
return true;
}
- // Continued function call
+ // Continued (template) function call.
if (ScopeStart > Start + 1 &&
- Changes[ScopeStart - 2].Tok->is(tok::identifier) &&
+ Changes[ScopeStart - 2].Tok->isOneOf(tok::identifier,
+ TT_TemplateCloser) &&
Changes[ScopeStart - 1].Tok->is(tok::l_paren) &&
Changes[ScopeStart].Tok->isNot(TT_LambdaLSquare)) {
if (Changes[i].Tok->MatchingParen &&
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 63ef294..246de2f 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -18525,12 +18525,17 @@ TEST_F(FormatTest, AlignConsecutiveAssignments) {
" a_longer_name_for_wrap}};",
Alignment);
- Alignment.ColumnLimit = 60;
+ Alignment = getLLVMStyleWithColumns(60);
+ Alignment.AlignConsecutiveAssignments.Enabled = true;
verifyFormat("using II = typename TI<T, std::tuple<Types...>>::I;\n"
"using I = std::conditional_t<II::value >= 0,\n"
" std::ic<int, II::value + 1>,\n"
" std::ic<int, -1>>;",
Alignment);
+ verifyFormat("SomeName = Foo;\n"
+ "X = func<Type, Type>(looooooooooooooooooooooooong,\n"
+ " arrrrrrrrrrg);",
+ Alignment);
}
TEST_F(FormatTest, AlignConsecutiveBitFields) {