aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2024-09-18 20:44:09 -0600
committerGitHub <noreply@github.com>2024-09-18 19:44:09 -0700
commitc9aa9d53b6f92d9780430ab8239ea9117574c95d (patch)
treec6ac10b294e08aa04eef362ca6c286d75d2b08f3 /clang/lib/Format/ContinuationIndenter.cpp
parent87dc3e89e72bb8d42d742c6a916f5fdee0bf853b (diff)
downloadllvm-c9aa9d53b6f92d9780430ab8239ea9117574c95d.zip
llvm-c9aa9d53b6f92d9780430ab8239ea9117574c95d.tar.gz
llvm-c9aa9d53b6f92d9780430ab8239ea9117574c95d.tar.bz2
[clang-format] Fix regression in BAS_AlwaysBreak for-await (#108634)
Fixes #108589.
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index f29f879..4e9ae41 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -809,7 +809,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
if (Tok.Previous->isIf())
return Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak;
return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
- tok::kw_switch);
+ tok::kw_switch) &&
+ !(Style.isJavaScript() && Tok.Previous->is(Keywords.kw_await));
};
auto IsFunctionCallParen = [](const FormatToken &Tok) {
return Tok.is(tok::l_paren) && Tok.ParameterCount > 0 && Tok.Previous &&