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

Theia Dobyns via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 8 12:37:26 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);
----------------
theia-ajax wrote:

Done.

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


More information about the cfe-commits mailing list