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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Feature request: Put curly brace on next line if function arguments are multiline AND start on new line.
        </td>
    </tr>

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

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

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

<pre>
    Having short function signatures, I prefer the curly brace at then end of it:

```cpp
void Grid::e_grid_edit_focussed(int index) {
    if (filter_grid(m_app)) {
        silvernode::ui::workspaces::GridWorkspace *gws =
 m_app->main_window()->get_grid_workspace();
```

When the function signature becomes longer, and the arguments span multiple lines, but still start on the same line as the function name with opening parenthesis, it's still fine:

```cpp
void Grid::e_ui_workspace_changed(silvernode::ui::workspaces::Type from,
 silvernode::ui::workspaces::Type to) {
    if (from == silvernode::ui::workspaces::GRID) {
 silvernode::ui::workspaces::GridWorkspace *gws =
 m_app->main_window()->get_grid_workspace();

```

But once the first argument also begins on a new line, under the function name and opening parenthesis, the indent of the function arguments, and the function body match, and it's super unclear to the eye where the arguments stop, and where the function begins:

```cpp
PhotoPreloadHandle Application::preload_photo(
    const std::shared_ptr<photo::Photo> &photo) {
    ZoneScoped;
    const std::string photo_path = photo->path().string();
    ZoneText(photo_path.c_str(), photo_path.size());

    photo::launch_initialization(photo, engine()->job_system());

```

So, instead, I'd rather see one of these options:

```cpp
PhotoPreloadHandle Application::preload_photo(
    const std::shared_ptr<photo::Photo> &photo)
{
    ZoneScoped;
    const std::string photo_path = photo->path().string();
    ZoneText(photo_path.c_str(), photo_path.size());

    photo::launch_initialization(photo, engine()->job_system());

```

or

```cpp
PhotoPreloadHandle Application::preload_photo(
    const std::shared_ptr<photo::Photo> &photo
) {
    ZoneScoped;
    const std::string photo_path = photo->path().string();
    ZoneText(photo_path.c_str(), photo_path.size());

    photo::launch_initialization(photo, engine()->job_system());

```

I can't seem to configure that in clang-format right now.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzslktv2zgQxz8NfRnEkCnbsg8-JHG97WURbAsU2ItAiSOJXYrUksM46adfUPQjzgPb9pRDgyCKyHlQ8_-RHOG9ag3ihi1u2GI7EYE66zZ9bYMjFOFhUln5uPko7pVpwXfWETTB1KSsgegqKDj0jN_CJxgcNuiAOoQ6OP0IlRM1gqA4ZACNBNuAIpZfs2zLsuPfZZZ-62FII_dWSfjDKRkt82ssW6dkiVJR2dg6eI-S8ZUyBMpIfGB8Day4Sb4AAKoBxleN0oRu9GV81ZdiGBhfvzCOP17pe3TGSkwZg0rPvXX_-EHU6NN7XNPX4xgwft3uPbB8e4g25rhi-YdeKFPulZF2z_iK8XUcbJHSh5yipjmW3zwrxNPqfI2liyV9WXaosLY9etDWtOiiCMLI0Vi4NvRoyIMfhIE-aFKDRtDKJLWqQOBJaQ2ehCOwKYkXfTIC4S-zmjizV9SBHdBEGgbh0FCHXo0RFTFe-EPQRhn8eZmDOtemrDth2lHoH1Xny-OA0DjbM357UOSnXMm-RZKz_Shzvv1xVP76tL0M904gexu1mxA5qDEJr5ynE0cgtLdQYauMj6wIMLgfQYnSByMP-_4Sl0jjG7RE47h5DcUz4cL1xO5ToE-z8TyCXlDdHaeP4IUBHQRTaxQOyI5u-Iiw79Dh811Bdjj6n-fPScYP_V-A7zpL9s6htkJ-FEZqhOth0KoWMUpSc0jT5RBtoxYntmprfNyEB_x9JxzKciDH8ttkPY7fpX8_AOPLQ5BnkP5tDX6u7YDypPJr8cmNOsQQ5SCoi0yl1whOHEmoTJPlM26Oib7gAzG-OoeZ1qUnd7Dmt08STL36fsTvBYEx3pOv1CKYuiuVUaSEVt9TBQ95Ylg07UjbEfRvtir9oyfs38rwKuOfx2DKeEIhx2uL8UKCE9ShA48I1uABSY9gh7iOd0zCYUG_cfg1HKx7l7qm1fze578u7CeohWG8oLin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