[clang] [clang-format] Add AlignConsecutiveEnums (PR #194154)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sun May 10 06:39:07 PDT 2026


================
@@ -1232,13 +1234,15 @@ class AnnotatingParser {
         return false;
       updateParameterCount(&OpeningBrace, CurrentToken);
       if (CurrentToken->isOneOf(tok::colon, tok::l_brace, tok::less)) {
+        assert(!Scopes.empty());
         FormatToken *Previous = CurrentToken->getPreviousNonComment();
         if (Previous->is(TT_JsTypeOptionalQuestion))
           Previous = Previous->getPreviousNonComment();
         if ((CurrentToken->is(tok::colon) && !Style.isTableGen() &&
              (!Contexts.back().ColonIsDictLiteral || !IsCpp)) ||
             Style.isProto()) {
           OpeningBrace.setType(TT_DictLiteral);
+          Scopes.back() = getScopeType(OpeningBrace);
----------------
HazardyKnusperkeks wrote:

That is reasonable, keep the old behavior. But the assert can be done once.

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


More information about the cfe-commits mailing list