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

    <tr>
        <th>Summary</th>
        <td>
            Clang-Format fails to properly format function call
        </td>
    </tr>

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

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

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

<pre>
    I'm using Clang-Format@18 to format a C++ project. I have a function call that is being formatted improperly. My [.clang-format file](https://github.com/llvm/llvm-project/files/13787860/clang-format.txt) is attached. I've tried different versions and configuration options but couldn't get it to work.

## What I got
```cpp
struct Bar {
 int get(int x) {
        return x;
    }
};

Bar create_bar(int param) {
    return Bar{};
}

int foo() {
 auto extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890 = 5;

    return create_bar(
 extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890
 )
        .get(5);
}
```

## What I expected
```cpp
struct Bar {
    int get(int x) {
        return x;
    }
};

Bar create_bar(int param) {
    return Bar{};
}

int foo() {
    auto extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890 = 5;

    return create_bar(
 extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890
 ).get(5);
}
```

I have tried changing all settings related to Indents, Constructors, Parameters, and function calls.
I also tried playing around with the brace wrapping style and with penalties.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVU2PozgQ_TXOpTQITAjkwGHSUaQ-rLS3Pa4KU4B3jI3sojv59ysD6Um2tYc-rVaaKHLiKnj19VQPQ9C9JapFcRLFeYczD87XF2eMtv2uce2tfhWyHGEO2vbwYtD23y7Oj8hin2YVsINuuQLCi5AnIU8wefcXKU7gFQZ8I0DoZqtYOwsKjQEekEEHaChirq8ztaDHybuJvLkl8NsNRHFK1BJwi9BpQ6I4C1kNzFMQ-XchL0Jees3D3CTKjUJejHm7_3zbEhHyEl8NQl6yvKzK6pAKeXmETvjKQh5jUsiMaqA2gVj4GwF7TS20uuvIk2V4Ix-0swHQtqCc7XQ_e1yqcxMvnmZmUG42rRWyZOiJQXNs1bvzPxKRnkX6fTtlLmQOf8SOvELveDMf0vWrpmm1BPazYjihB1GeVhtou4ALWcV_11jBT-f28cSzt3AV-YNDlOctUHn-cKxnjKA8IdOfDfoNekKP4yf4DfqEPpofkT7glzMidM4JWT1D4MwO6MqeRjI3Q7bn4WZxpOAiRZYBrfMJrI1ZswpotKXGE_4wxKxtP1IY3LvCQDzQ5F1j6INIaNt3zYObucPZcCbzfXEoq2MKIj9D8Y_aH4p6asHm_Y9S3aILeXyebLKOvoiOz52_M-jf2UbXiRRT-yXKAfzfWQfwi3hfJd7Xqbat_nV5qgFtH3d93P5hzSiAJ4Nx7bODV9uS5SDkC7w4uxLP-eX-eyQBMa23uHOfxCQk93hogtviTQZvSzjvZttCrA54IGg8KoJ3j9MU3YFvhhbI5YmJLBrWFJJdW-ftMT_ijuqsTPOyPJb5YTfUJVKj2qZK951s1XGvKpWVadYcUpUWe1nudC1TmWdSVtkhrQqZ5DlmKe7l4ZjlWUWp2Kc0ojZJFKjE-X6nQ5ipLg9Flu0MNmTCosZSPgqUkDLqs68XXWvmPoh9anTg8BOINRuqHyUaOtQmxAbfZ30X66ce7mZv6i9L6pJ31NQl9b8DAAD___6TpgY">