[clang] [clang-format] allow short function body on a single line (PR #151428)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 31 01:51:40 PDT 2025


================
@@ -532,6 +538,20 @@ class LineJoiner {
       }
       return MergedLines;
     }
+
+    // Previously, UnwrappedLineParser would move the left brace to a new line
+    // when AllowShortFunctionBodiesOnASingleLine is enabled. However, if the
+    // function body cannot fit on a single line, and Style.BraceWrapping.AfterFunction
+    // is false, we should merge the function name and the left brace back onto
+    // the same line
----------------
HazardyKnusperkeks wrote:

```suggestion
    // the same line.
```
Comments end in full stop.

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


More information about the cfe-commits mailing list