Index: clang/lib/Format/TokenAnnotator.cpp =================================================================== --- clang/lib/Format/TokenAnnotator.cpp +++ clang/lib/Format/TokenAnnotator.cpp @@ -175,11 +175,9 @@ Contexts.back().IsExpression = false; } else if (Left->Previous && (Left->Previous->isOneOf(tok::kw_static_assert, tok::kw_decltype, - tok::kw_if, tok::kw_while, tok::l_paren, - tok::comma) || - Left->Previous->endsSequence(tok::kw_constexpr, tok::kw_if) || + tok::l_paren, tok::comma) || Left->Previous->is(TT_BinaryOperator))) { - // static_assert, if and while usually contain expressions. + // static_assert and decltype while usually contain expressions. Contexts.back().IsExpression = true; } else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous && (Left->Previous->is(Keywords.kw_function) || @@ -1635,7 +1633,7 @@ return true; } - /// Return the type of the given token assuming it is * or &. + /// Return the type of the given token assuming it is *, &, or &&. TokenType determineStarAmpUsage(const FormatToken &Tok, bool IsExpression, bool InTemplateArgument) { if (Style.Language == FormatStyle::LK_JavaScript)