<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJztVklv6zYQ_jXyZWBBi9eDD0mcAAZe-3opejQocSSzoUiXix3_-w4p27Ff7DZA8A4FSgiSyFk4Gz9OpflhsQKlnaiRA4Ot0ZXEDpJipg14hW9brB2RKtywndDeJMUc9sJtoJZMtcNGm465YV6CwZYZLlQLTIpWdagc6AaYtceZBaGg1l0lFHNCq16NUJxocSEpXq5EG6_qyMhM66OGNMmWSfbQv38RSnRMQjLJ0ktjaJ6UR57w3z9x-hDUP2llsfZO7PDh3TgSgQvKiV_qPb0eTgZ8V7_im_smFAb-hkl75HwU6jdWv54ZfyA_aek79U10wgVKnh0NWkXv_xDcbcL66KbVz2-s20qk2HGkRJCXCL2rjsL90de6n--04NAd1qcwUk5D8pLpY08HGhRyeiBNU-iC2rDFZYwDj6BskBqpVbveMSMYVchasQ7XIYFryoKDpFxCnpSP11IG3ToaHchWk8SFLY0w1vVaT_lNiiegBGjFP667jTA3lhsqSTLih_X52ZRPuTpd3q6WxqH5j0X6zvh8At71_uO4k6ZPSt9O5ieFf2bKj4m3cNAeaqbIT-yrDy-RKqATydwMwiQDpniUaHTAjwCJwkLFeAqrBvYIXHBKwNQBYSpGzvuQ6WCvveQ9a4UYINQYAuVgVoURb13UIXGHMsiHid4SZ2UIktDRtpdKzph-baL2buvd_zX-r-NrpX9nfOlE3Bk_86A876i-REOVRZarV3pTFUqtXy385YVD8K08hBKlC6-YUvWjC2BKbHTvB94VtOig9lTLyvWs4djQlalPMklRnGu9gFaELfuaPSEyGC_Rhq5lJzjyq_ZgZYNplpqaV6X36tTaJOULfDfhQPbU2nkm5eH9VJzOwculssv-AnZobCgvurApHr9XXjkPtzggL9MszYdJ8UhPkRVFlmezbFbm-YgWqqbKK55X83k2GebJ9JlsCJ9LxnGejua0y4AvSj4v52zAvNtos9jGgFqrFYXNILMDb-Ri49w29B59Qls6Ub5KqeeiiZS702dIsfgzhvVFWOvR0s-Y9soGm0U9LzifFXUzKiYVK6azyawZZRWOqgnL83I8kKxCaRfJmHwqFO4hqqD_ZLwcfN0CsejdzwtqkmbjUcqLSZ3NpvNpOZmNGObJKMOOCZkGPak27cAsosrKt5aIUlhqFM_EHkwRo8FkoRNOxslVyzheQuwNI5xewG8outC3HuvwY0v6jtyD6MgievE3QAFvyw>53150</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Aligning assignments gives incorrect function argument alignment
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    I noticed a problem (or unexpected behaviour) with clang-format-13 regarding alignment of assignments in combination with indentation/alignment of function arguments.

Minimal `.clang-format`:
```
AlignConsecutiveAssignments: Consecutive
AllowAllArgumentsOnNextLine: false
BinPackArguments: false
ColumnLimit: 100
IndentWidth: 4
```
Example code before formatting:
```c
void my_function() {
    // ... more code

    int my_long_variable_name_with_init = 1;
    int ret_code = some_function(first_long_argument, second_long_argument, third_long_argument, fourth_long_argument);

    // ... more code
}
```
After formatting:
```c
void my_function() {
    // ... more code

    int my_long_variable_name_with_init = 1;
    int ret_code                        = some_function(first_long_argument,
                                 second_long_argument,
                                 third_long_argument,
                                 fourth_long_argument);

    // ... more code
}
```

As you can see, the indentation of `second_long_argument` and the following is bad. If we didn't have the alignment of assignments it would have been correct, being at the level of the open bracket. I would have expected the following output:
```c
void my_function() {
    // ... more code

    int my_long_variable_name_with_init = 1;
    int ret_code                        = some_function(first_long_argument,
                                                        second_long_argument,
                                                        third_long_argument,
                                                        fourth_long_argument);

    // ... more code
}
```
Even if I think that looks quite ugly, it's better than what I get currently, and also it's "correct" given the formatting rules provided.

Is this a known problem? Or is this actually expected output?

clang-format version: `Ubuntu clang-format version 13.0.1-++20220108083114+bfb1bd1b9906-1~exp1~20220108083151.49`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztVkuP4jgQ_jXhUiLKAwgcODT9kJBmd_ay2iNy4krwtGMzfkDz77ecAB2mYbel0RxWWitKYtfDXz1crlLz43INSjtRIQcGO6NLiS1E2Vwb8Arfdlg5IpW4ZXuhvYmyBRyE20IlmWrGtTYtc-M0B4MNM1yoBpgUjWpROdA1MGtPMwtCQaXbUijmhFa9GqE40bqFKHu5Eq29qjpGZhrfaYij5ClKHvr3b0KJlkmIZkk8BEPzKD_xhP_-6aYPQf2jVhYr78QeH97BkQgMKGd-qQ_0ejgD-Kp-xzf3RSgM_DWT9sS5EuoPVr1eGH8gP2rpW_VFtMIFSpqcAK076_8S3G3D-uQm6uc31u4kku84UiDISoTeVEfu_mhr1c_3WnBoj5uzGymmIXhRserpQINcTg_EcQxtUBu2GPo48AiKBqmRWjWbPTOCUYZsFGtxEwK4oSg4iPInSKN8dS1l0G060IFsNUkMsNTCWNdrPcc3yh6BAqAV_7jutsLcWK4pJQnED-uLC5RPmVo83c6W2qH5j3n6zvh8AN71_uO4E6ZPSt8O5ieFf2XIT4G3cNQeKqbITuyzD4eVKlQnkrnphFkCTPFOotahfoSSKCyUjMewruGAwAWnABQOqKZix3m_ZDo4aC95z1oihhJqDBXlAKvErt66TofEPcogHyZ6R5yloZKEjrYdKrnU9GuI2rudd__n-L-On0v9O-OnTsSd8SsPyvOe8kvUlFmEXL3Sm7JQav1q4bsXDsE38hhSlC68rKDsRxeKKbHRvR9419Cgg8pTLivXs4ZjQ1emPstEWXbJ9QwaEbbsc_ZckcF4iTZ0LXvBkV-1B2sboFlqal6VPqhzaxPlL_DVhAPZUyvnmZTH91NxPgcvQ2XD_gL2aGxIL7qwyR9_ll45D7c4IM3jJE7HUbaiJ0uyLEmTeTLP03RCC2VdpiVPy8UimY3TqHgmDOEzZJym8WRBu4z4MueLfMFGTjiJy2i6uup5pk_QNTddPRjUj-C10HidHPmxp3ovPSNv5HLr3C40L31GNHQkfRlT00YTKffnz5ic-a2Ly4uw1qOlnymBTUbbZbHI8qJIixrTIuWTokrTqmTzBSZYJGmdjSQrUdpgAYVV4QE6FfRPRozEsrc-zahHmk8nMc9mVTIvFkU-m08YptEkwZYJGQccsTbNyCw7SKVvLBGlsNQnXoi9L7BzWNDPvNtqs9x16WitVpR0BpkddSCWnRF_A5yfWgM">