[clang] [clang-format] Fix BlockIndent compat mapping of AlignAfterOpenBracket (PR #207187)

Sergey Subbotin via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 4 16:44:36 PDT 2026


================
@@ -652,6 +652,31 @@ TEST(ConfigParseTest, ParsesConfiguration) {
   CHECK_PARSE("AlignAfterOpenBracket: false", AlignAfterOpenBracket, false);
   CHECK_PARSE("AlignAfterOpenBracket: BlockIndent", AlignAfterOpenBracket,
               true);
+  // BlockIndent implies breaking after the open bracket and before the close
+  // bracket of braced lists, function calls/declarations, and if conditions.
+  Style.BreakAfterOpenBracketBracedList = false;
+  Style.BreakAfterOpenBracketFunction = false;
+  Style.BreakAfterOpenBracketIf = false;
+  Style.BreakAfterOpenBracketLoop = true;
+  Style.BreakAfterOpenBracketSwitch = true;
+  Style.BreakBeforeCloseBracketBracedList = false;
+  Style.BreakBeforeCloseBracketFunction = false;
+  Style.BreakBeforeCloseBracketIf = false;
+  Style.BreakBeforeCloseBracketLoop = true;
+  Style.BreakBeforeCloseBracketSwitch = true;
+  EXPECT_EQ(
----------------
ssubbotin wrote:

Done — moved the flag presets before the existing `CHECK_PARSE` and dropped the second `parseConfiguration` call (fc6dbe94c9).

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


More information about the cfe-commits mailing list