[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 15 01:40:33 PDT 2024


================
@@ -4493,13 +4493,11 @@ struct FormatStyle {
   bool SpaceBeforeRangeBasedForLoopColon;
 
   /// If ``true``, spaces will be inserted into ``{}``.
-  /// \code
-  ///    true:                                false:
-  ///    void f() { }                   vs.   void f() {}
-  ///    while (true) { }                     while (true) {}
-  /// \endcode
+  /// This option is **deprecated**. The previous behavior is preserved by using
+  /// ``SpaceInEmptyBraces`` with ``Custom`` and by setting ``Block`` in
+  /// ``SpaceInEmptyBracesOptions`` to ``true``.
   /// \version 10
-  bool SpaceInEmptyBlock;
+  // bool SpaceInEmptyBlock;
----------------
owenca wrote:

I was reviewing this PR and running into some issues related to https://reviews.llvm.org/D68415. I felt that we had to bite the bullet and add a new boolean option like the author did initially.

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


More information about the cfe-commits mailing list