[clang] [clang-format] Honor AllowShortFunctionsOnASingleLine.Other w/o Empty (PR #235369)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 16:59:39 PST 2026


================
@@ -337,17 +337,27 @@ class LineJoiner {
       }
     }
 
+    // Whether the function body is empty, checking the line after the left
+    // brace, which may be wrapped onto its own line.
+    const bool LBraceWrapped = NextLine.First->is(TT_FunctionLBrace) &&
+                               NextLine.First == NextLine.Last;
+    const bool IsEmptyFunction =
+        LBraceWrapped ? I + 2 != E && I[2]->First->is(tok::r_brace)
+                      : NextLine.First->is(tok::r_brace);
----------------
gedare wrote:

These are only used in the lambda, should they be defined inside?

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


More information about the cfe-commits mailing list