diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index cb5baae565321b..f3885a1f683bc4 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -982,10 +982,11 @@ class AnnotatingParser { Tok->setType(TT_JsTypeOperator); break; case tok::kw_if: - case tok::kw_while: - if (Tok->is(tok::kw_if) && CurrentToken && + if (CurrentToken && CurrentToken->isOneOf(tok::kw_constexpr, tok::identifier)) next(); + LLVM_FALLTHROUGH; + case tok::kw_while: if (CurrentToken && CurrentToken->is(tok::l_paren)) { next(); if (!parseParens(/*LookForDecls=*/true))