[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
Sat Jan 11 21:58:45 PST 2025
================
@@ -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.
Actually, we might be able to support the following:
- Always (`WebKit` default)
- Block (`LLVM` default, which would deprecate `SpaceInEmptyBlock`)
- Leave (to be implemented in this patch or a follow-up patch)
- Never (ditto)
https://github.com/llvm/llvm-project/pull/93634
More information about the cfe-commits
mailing list