[clang] [clang-format] Apply SpaceBeforeInheritanceColon to enum underlying types (PR #189011)

Tharun V K via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 28 18:27:59 PDT 2026


================
@@ -1444,9 +1444,9 @@ class AnnotatingParser {
                   Scopes.back() == ST_Class)) {
         Tok->setType(TT_BitFieldColon);
       } else if (Contexts.size() == 1 &&
-                 Line.getFirstNonComment()->isNoneOf(tok::kw_enum, tok::kw_case,
+                 Line.getFirstNonComment()->isNoneOf(tok::kw_case,
                                                      tok::kw_default) &&
-                 !Line.startsWith(tok::kw_typedef, tok::kw_enum)) {
+                 !Line.startsWith(tok::kw_typedef)) {
----------------
tharunvk wrote:

This line checks if line starts with typedef followed by enum. So I have to remove this entire line "!Line.startsWith(tok::kw_typedef, tok::kw_enum)" to handle typedef enum case

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


More information about the cfe-commits mailing list