aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/WhitespaceManager.cpp
diff options
context:
space:
mode:
authorBjörn Schäpers <bjoern@hazardy.de>2023-10-03 15:35:30 +0200
committerGitHub <noreply@github.com>2023-10-03 15:35:30 +0200
commit1f0126902876cb42a7502047e62bdf512fd96b02 (patch)
treefae66a280404674430a945bd3c015225366a3ad2 /clang/lib/Format/WhitespaceManager.cpp
parent1482106c9960300e729b1a58e5e25b6ac1c150ba (diff)
downloadllvm-1f0126902876cb42a7502047e62bdf512fd96b02.zip
llvm-1f0126902876cb42a7502047e62bdf512fd96b02.tar.gz
llvm-1f0126902876cb42a7502047e62bdf512fd96b02.tar.bz2
[clang-format] Fix alignment in presence of template functions (#68029)
Fixes #68102.
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r--clang/lib/Format/WhitespaceManager.cpp5
1 files changed, 3 insertions, 2 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 &&