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

    <tr>
        <th>Summary</th>
        <td>
            clang-format doesn't understand forwarding refs in C++20 lambda syntax 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++20,
            clang-format
      </td>
    </tr>

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

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

<pre>
    Your suggested formatting:
```cpp
  [&]<typename Callable>(Callable&& callable)
    requires std::is_invocable_v<Callable>
  {
 static_cast<void>(callable);
  };
```

clang-format's current output:
```cpp
  [&]<typename Callable>(Callable && callable)
 requires std::is_invocable_v<Callable>
  {
 static_cast<void>(callable);
  };
```

clang-format doesn't seem to understand that `Callable` in the expression above is a templated type, so the `&&` should group with `Callable` and be formatted in the usual manner for forwarding or rvalue references. Instead it seems to think that `&&` is a boolean operator and `Callable` is an operand.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVMFu6zYQ_BrqsohBk7ZsHXSInRroJ_QUUOJKYkuRKnfpl_x9QTl23Ae8Ww8FbFFLrWZ2RgMaIjcGxFbsT2L_VpnMU0xtpo9mX3XRfrZ_xJyA8jgiMVoYYpoNswuj0K9Cvgn5Kmp5-_XLctsBKHCqFvs3oc_8uWAwM8LZeG86j0L_JtTxUalaqBr6R9ncQQAS_p1dQgJiW_j0q6N3F66xL63vV6HPz6B38sPp65bYsOvfe0Ms9Pkanb1xP5Pp0_d7b4_qIeqrXK-9N2F8uVkg1IGgzylhYIiZl8z_lSPwS0v-x36AjUhBqAMDIc7AEXKwmIhNsMCTYRC1fExXS3ABeELAjyUhkYsBTBevCI7AAOO8eFMSV8wS6gwU1_YywmpPgaApZm9hTDEv8MPx9DNH4e7wnlq0d9JM2XiYTQiYytPy_2GSdWGEmCBdjc8ICQdMGHqkDfweiNFYcDd9VATy5MJfD23fY60Kuhg9mgBxwWQ4pnWWny0guHcEu6lsq22jG1Nhu60PRy31UctqatWhNzgct42Vgx2Gbd3td4edbPad3u50t6tcq6TSUsvjtinLZjBNfbDDcSeb434vldhJnI3zG--v8yamsXJEGdt6q-qm8qZDT-sZoFQv1Emok5JCKaHOZedfsVflnEhtAXrp8khiJ70jpm9oduyx_UU4nkLx5HnCgcq3Od_JwZu5swboM7D5gCon307MC5XYq4tQl9HxlLtNH2ehLoX7a3lZUvwTexbqsmokoS6rzH8CAAD__7DzhTc">