<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/109864>109864</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Include sorting is broken with backslashes in multiline comments.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Jhuighuy
</td>
</tr>
</table>
<pre>
Hi everyone,
The latest released `clang-format` (19.1.0) cannot sort includes and remove duplicates if those are preceded with `/* */` comments containing backslashes. `clang-format` 18 produces correct results.
Example:
```cpp
~ » cat a.cpp
/* COPYRIGHT *\
\* (C) 2024 */
#include <b>
#include <a>
#include <b>
~ » clang-format a.cpp
/* COPYRIGHT *\
\* (C) 2024 */
#include <b>
#include <a>
#include <b>
~/cf-test » cat b.cpp
/* COPYRIGHT *
* (C) 2024 */
#include <b>
#include <a>
#include <b>
~/cf-test » clang-format b.cpp
/* COPYRIGHT *
* (C) 2024 */
#include <a>
#include <b>
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMlE1vnDAQhn-NuYwWgWEJHDgkJNukl1ZVLj36YwA3xka22TaX_vbKu2xKq1TtpVIkxMfYZp537HmZ92owiC3Z35D9bcKWMFrXvh8XNYzLc8KtfG7vFeAR3bM1SGgHJLsl2fX5_jgiaBbQB3CokXmUQKpMaGaGXW_dxAKpMiC0zps0TzNCGxDMGBvAWxdAGaEXiR6YkeBwskcEucxaifhTUD2E0XoE5hBmhwIlSviqwhizEHog9BoIvY5vVQbCThOa4EFYE5gyygzAmXjymvkRffoaWl7D7KxcBMZlzqGIUvyig0-3Su--sWnWSIr1O-Y_XWKez5HvQDpKbm5AsAAsfYmvmN2Hj58_Pby7fzwB77t1cN-dNdRdrA3NaAkXRZvshBZrqYAUHSfF3Wtx9of4Zv5vpJtivHFkQg-i351O2qbM_C_MpxF4G7jbWv8v7n_gu5zbRLaFbIqGJdjmV_SK5nldNcnY5kUvGVay4Mh72mCFVYkZk7wsKMv3PFFthMkaWtI8K2mdyoqJvuA172vKC4qkzHBiSqdaH6fUuiFR3i_Y5llTV2WiGUftL5bj2jhrx5fBkzLTygf_c11QQZ_M6Ze23d_Cw6otukhsc-WBO_uE5uwOm64HZWBadFBaGXyxiDRZnG7HEGYfWzruwWFQYVx4KuxE6CEirI_d7OwXFIHQw0mHJ_SwSjm29EcAAAD__7TqfvU">