[clang] [clang-format] Fix regression in AlwaysBreak for-await (PR #108634)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 22:19:12 PDT 2024


================
@@ -809,7 +809,7 @@ 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, Keywords.kw_await);
----------------
owenca wrote:

```suggestion
                                  tok::kw_switch) &&
           !(Style.isJavaScript() && Tok.Previous->is(Keywords.kw_await));
```
as `await` is not a keyword in C++, Java, etc.

https://github.com/llvm/llvm-project/pull/108634


More information about the cfe-commits mailing list