<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59450>59450</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Add `friend` to QualifierOrder for reordering friend functions.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
red1bluelost
</td>
</tr>
</table>
<pre>
It would be useful to have `friend` in QualifierOrder so that the formatter will consider it when reordering the qualifiers in friend function. An example case would be when defining spaceship operator.
```c++
struct S {
int i;
// each are valid orders
friend constexpr auto operator<=>(const S&, const S&) noexcept = default;
constexpr friend auto operator<=>(const S&, const S&) noexcept = default;
constexpr auto friend operator<=>(const S&, const S&) noexcept = default;
};
```
https://friendfmt.godbolt.org/z/eYEonGajK
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0U81upDgQfpriUgoC89d94NBJh9VqD6tRTnM0pgBHbpuxy-nMPP0IupN0cp6RLMCm6vsp65Mh6MkStVDdQ3VMZOTZ-dbTkPcmknGBk94NP9t_Gc8umgF7whhojAbZ4SxfCKHORq_JDlBnqC1-i9LoUZP_3w_kMTjkWTLyTDg6f5LM5PGsjUHlbNBrjWY8z2TRk1t7tJ228h9vSGHFvZDgGK1i7WyKB4v0Kk-LIVQy0IfADWugUdsVKSxSUZj1gm4hL9n5FLIjZIfrs84uS4G4X9d2GthHxfiE0FxPELVl1FDc33YjguhAdEhSzSg94Ys0esDNR3iruUpf_TK9Lh5lZPcuB4oHKI5QPILYbSX4BKIG8YC3uz1aR6-KFkYojqs9GQ2_y8Eb9Cvd3yXZ0K9Mf5QEmuPH99vl4GU_My8BisNl6Bf28cTp5IbeGU6dn0B0v0B09P3R2X_k83_J0BbDvtjLhNq8brJm3zRlncwtiarMa5nvqqreFZUqR7nPaVeVeSabZpcnuhWZELnIcyHEPqvTcVflclBZUTa1akhAmdFJapMa83JauRMdQqS22pdVlhjZkwlbsoSwdMbtJwixBs23a89dH6cAZWZ04PCBwprNFkllpJ3uLqmB6oiHYfgcN3Zf4zY6fxujL6EJaRK9aT-PcdI8xz5V7gSiW0VcX3eLd8-kGES3SQ8gus3a7wAAAP__MFFWgA">