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

    <tr>
        <th>Summary</th>
        <td>
            clang format: lambda body indendation thrown off by capture block arguments
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    With clang format 16, and
```
LambdaBodyIndentation: OuterScope
WhitespaceSensitiveMacros: ['QObject::connect']
BinPackArguments: 'false'
BinPackParameters: 'false'
```
Having an extra capture argument in the lambda throws off the indentation:
```
 QObject::connect(obj, &QObject::someSignal, slotObj, [this]() {
     this->dosomething();
 });
 QObject::connect(obj, &QObject::someSignal, slotObj, [this, to]() {
 this->dosomething(to);
 });
```
The first connect statement is correct, the second is not. As soon as the capture block has more than one argument in it the alignment is wrong. We are adding the connect statement to WhitespaceSensitiveMacros because we are unable to configure clang-format to not change line wrapping of function arguments.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVEFv6zYM_jXyhWhgy4kdH3xI2gUbsKFv6ICeaZm29SpLgUQ3678fZDtvTZftNMOAIfMj-VHkRwxB95aoFruj2D0lOPHgfI1vnfOeAieNaz_qV80DKIO2h875ERmyQshHQNuK9EmkB1Gk6zsff8WxafHo2o9fbEuWkbWzIj_A88TkX5Q70wJ8HTRTOKOiF7JBs36n31B5FyI4UpLl78_Nd1Is8oPID8pZGw-yFLunJcRR22-o3g6-n0ayvHjKskMTKOI-g76hx5GY_H3Ulyp-xndte0AL9Cd7BIVnnjwBrqlAW-CBwMzVAg_eXQK4rpv_6pvK7yaA-7XtXfM93q6QxQ0guJFedG_RRGswjp9X4O7Igw7xSuReyApEeVwzxCfaHkT-U-tiBB607RecyK8wUT7dnP9nYvIR2N2jd58au_8i9-US_xgIOu0Dw8oTAiPT0qAAKs5xJP84dyWQcraNBut4A4cAwTkLGGbrtcONceoNBgwwOk_AA1pw9rbzmmcXNLq312QX72y_gdeIJMC2jfMzB_4HNXbwr8MPDSmcAsFlCTRZbAxFF-Vsp_tIcVbjw6pGdrEcUAPansBoS3DxeD7H9K6DbrIqzuEP_mGTtHXeVnmFCdVZsd-lWVXIKhnqdluUaUFZ1knaEjWqpWKPCsuiKKu02Se6lqnM053cZXmaymqTVdtGEakyS4u0qDKxTWlEbTbGvI8b5_tEhzBRXcgq3ycGGzLhum58HUEPzdQHsU2NDhz-dmPNhurPayeqdlVb3EuLxtpZY4v87Cy_5uNLJ3_UnUze1APzOS4AIU9CnnrNw9RslBuFPMXc6-fh7N084vI08w9CnuYS_goAAP__3NKqtw">