<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/93635>93635</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] unable to insert a space only for non-code block empty braces, not for empty parentheses
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          khei4
      </td>
    </tr>
</table>

<pre>
    WebKit has [its own `.clang-format` ](https://github.com/WebKit/WebKit/blob/main/.clang-format) and [clang-format has `basedOnStyle: WebKit`](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#basedonstyle), but it's inconsistent with [internal style checker script](https://github.com/WebKit/WebKit/blob/main/Tools/Scripts/check-webkit-style), at least for the empty initializers.
For example, the following line, tweaked from [WebKit source code](https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp#L222), would be checked by the script 
```c++
 toImpl(listenerRef)->use( {} );
```
```bash
$ python Tools/Scripts/check-webkit-style
ERROR: Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp:222:  Extra space after ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp:222:  Extra space before )  [whitespace/parens] [2]
ERROR: Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp:222: Missing space inside { }.  [whitespace/braces] [5]
```

A space in empty braces is required, but one in (also for empty) parens isn't allowed.

Current clang-format could insert a space in empty parenthesis and block simultaneously by turning on [SpacesInParensOptions.InEmptyParentheses](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#spacesinparensoptions), but formatting only braces couldn't be achieved.

So we want to insert a space only for braces.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vt1u4zYTfRr6ZmBDpiTbutCFE0dA8H3FLpI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