<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75815>75815</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format is confused by C# 'new' modifier
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
russellw
</td>
</tr>
</table>
<pre>
It seems that use of the 'new' method modifier in C#, causes clang-format to become confused, and mangle the formatting. This example formats correctly without the 'new' modifier, but is mangled with it:
```
sealed class OrderedSet<T>: List<T> {
public new void Add(T item) {// In theory, this is O(N) per item
// but in practice on modern hardware
// it is fast for the anticipated range of N
if (!Contains(item)) base.Add(item);
}
}
```
[OrderedSet.cs.txt](https://github.com/llvm/llvm-project/files/13705682/OrderedSet.cs.txt)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk9-umzgQxp_G3IyKYAgBLrg4J9lIlVbtxZ4X8J8JeGXsyB6a5u1X5oTttltpt5KVYBh_fPMbPpmSnTzRKNpX0Z4LufIc4hjXlMi5e6GCeYwfGRLRkoBnybAmgnAFngkEdp7uAjtYiOdgYAnGXi1FsB5OAhuBJ9ByTZRAO-mnD9cQF8nAARTpsBDo4K9rIpMrpTewSD852tTfa9n6qYS32Sagr3K5uf1BAh1iJM3uAXfLc1j5R1NPN1lbrQw2PeXNdgAsi-ZFVGdR7b_H6rm2bSKZa7WTKcHnaCiS-YNYNKc30fwmmhf43aZ9C6J73bWG26qc1eDpDl-CNfBijMD-DSzTInDYavEi8AIffTYd4iOb5NylTfBZYP8p190yynxmF_7pgqfW1qOHW5SarSYIPiOg6GGW0dxlpP-nYzdUV5k4o96gSs9W25tkMhCln7ZP4NN_yNkrCOwF1qfgWVqfBPZPArk5JROV72T2u82OsDv_ePH9aET7-m0gpU4lf2XRngX2M_Mt5bluvUyW51WVOiwCL8592f8-3GL4kzQLvFytoyTwUjdd1R57FHj5tzQO7-8tzNiYoRlkQWPdVTjUh6bDYh5RteaotDZKDrVS1aCITHM8dD3JBlVf2BErbGqs-7o9HGssa2yPQ1u1XWW63uAgDhUt0roy-ytDnAqb0kpj1_Z1WzipyKUtpoj_zJJAzMGN49aWWqckDpWzidM3IbbsaPwugTb9HT1Qjy2sP0lOsUY3_jLRzXdGuln_KwAA__96cFWa">