[clang] [clang-format] Add option to omit wrapping for empty records (PR #151970)

Tomáš Slanina via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 11 08:22:29 PDT 2025


================
@@ -1585,6 +1611,8 @@ struct FormatStyle {
     /// \endcode
     ///
     bool SplitEmptyNamespace;
+    /// Wrap empty record (``class``/``struct``/``union``).
+    BraceWrapEmptyRecordStyle WrapEmptyRecord;
----------------
itzexpoexpo wrote:

I sadly don't see a way to implement this merge cleanly, in either case it'd stand out from the other `SplitEmpty` options. Would extending to enum/namespace and calling it `WrapEmptyBlock` be a more acceptable choice? Or just making the option bool to reduce changes size? Thank you for taking the time to review

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


More information about the cfe-commits mailing list