[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
Sun Jun 9 17:51:16 PDT 2024


owenca wrote:

> See [#93635 (comment)](https://github.com/llvm/llvm-project/issues/93635#issuecomment-2138778128).

@khei4 maybe an `enum` for `SpaceInEmptyBraces` with `Always`, `Never`, and `Custom`. (IMO `Leave` doesn't make sense.)

With `Custom`, a list of boolean suboptions e.g. `Function`, `List`, etc. can be set individually.

We have the following brace types now:
```
BlockLBrace
BracedListLBrace
ClassLBrace
ControlStatementLBrace
ElseLBrace
EnumLBrace
FunctionLBrace
InlineASMBrace
LambdaLBrace
NamespaceLBrace
ObjCBlockLBrace
RecordLBrace
RequiresExpressionLBrace
StructLBrace
SwitchExpressionLBrace
UnionLBrace
```
I would implement all that make sense or are applicable to WebKit.


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


More information about the cfe-commits mailing list