[clang] [clang-format] Disable short blocks if brace is on the new line (PR #196021)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 15 07:31:22 PDT 2026


================
@@ -895,6 +889,11 @@ class LineJoiner {
         Line.startsWithExportBlock()) {
       if (IsSplitBlock)
         return 0;
+      // The construct-specific options AllowShortIfStatementsOnASingleLine and
+      // AllowShortLoopsOnASingleLine take precedence over
+      // AllowShortBlocksOnASingleLine: a statement whose specific option
+      // disallows merging is not put on a single line even when short blocks
+      // are always allowed.
----------------
gedare wrote:

You should be able to achieve that with `AllowShortFunctionsOnASingleLine.Empty`.

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


More information about the cfe-commits mailing list