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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] `BreakAfterAttributes: Always` Inconsistency with operator overload
        </td>
    </tr>

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

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

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

<pre>
    With `BreakAfterAttributes: Always` the following code:
```cpp
class Test {
    [[nodiscard]] Test& operator+(const Test&);
    [[nodiscard]] Test& test(const Test&);
};
[[nodiscard]] Test& operator-(const Test&);
```
gets formated to this:
```cpp
class Test {
 [[nodiscard]]
    Test&
    operator+(const Test&);
 [[nodiscard]]
    Test& test(const Test&);
};
[[nodiscard]] Test& operator-(const Test&);
```
This option formats a member function correctly, but it forces a member operator overload to break after the return type, and the non-member operator overload is completely ignored and is not formatted.
Using `clang-format version 18.0.0 (https://github.com/llvm/llvm-project.git a6c02edd6eac476523b5c73f29619a7a9e054872)`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVE2P2zgM_TXyhYghy5Y_Dj4kGwTY-yy2V1libLWKZEj0DPLvCzuTzhTtFJlTgQCKSer5vUeaKiU7esSeyQOTx0wtNIXYfzniBbMhmGv_v6UJWM0PEdW3_Zkw7omiHRbCxMo97N2LuiZWc6AJ4RycCy_Wj6CDQVbuGT8yvmc1v_30PN8i2qmU4AkTAWsOtxgAwMbj4IOxSatomDwyedzqmKghzBgVhcjEgYlWB5_onmOiY-XDQLSdHyOw5vj2_yFKuz_C3fXfHkekBOcQL4rQAAWgyabPmvVbWm_67yx-BB717jHcv-zg02QThJls8K9GJlBwwcuAEc6L11tGhxhRk7sy8Q8MC4GltVrju-L72yE8Y3RBbf0Y1mEHtU77NtYRaYke6DrjCqW82cI--N2HMDaBDpfZIaG7gh19iGi2qzaBD_TKm9DkN03_pfW7WfvulB93tzQ8Y0yrlqLNec6BiXYimrdpEScmTqOlaRlyHS5MnJx7vh-7OYavqCkfLYGqNRdoTI1KV00tRTlI3ZRn0dVFpxrVIZdV24jV8Zpnpi9NV3Yqw75ouOBN13KZTX0ry0LqopNDI4qiMLKoyrZErVRbm3OnM9sLLspC8FaUsq5kLppBDspoVEJUGgtWcbwo6_KVYh7imNmUFuybquNF5tSALm27SIj3LjAh1u0U-03ZsIyJVdzZROkNiCy5bY_9dFEeH1te__p19Gwi9PoKL-vS-6Wl2RJd_zn3mThtAhMTp03j9wAAAP__yGSr7A">