<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61498>61498</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Regression in clang-format version 16?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
prj-
</td>
</tr>
</table>
<pre>
Steps to reproduce:
1. download [reproducer.tar.gz](https://github.com/llvm/llvm-project/files/11009158/reproducer.tar.gz) which includes `petscstring.h`, `.clang-format-15`, and `.clang-format-16`;
2. run `clang-format-15 --style=file:.clang-format-15 petscstring.h 15.h`;
3. run `clang-format-16 --style=file:.clang-format-16 petscstring.h 16.h`;
4. `diff 15.h 16.h`.
This should produce the following unwanted diff.
```diff
--- 15.h 2023-03-18 18:07:05
+++ 16.h 2023-03-18 18:07:02
@@ -474,7 +474,7 @@
#if PetscHasBuiltin(__builtin_strchr)
*c = (char *)__builtin_strchr(a, b);
#else
- *c = (char *)strchr(a, b);
+ *c = (char *)strchr(a, b);
#endif
PetscFunctionReturn(PETSC_SUCCESS);
}
```
For reference only.
```
$ clang-format-16 -version
clang-format version 16.0.0
$ clang-format-15 -version
clang-format version 15.0.7
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PozgQ_TXFpQQy5vvAIR-D9jiazJ4jgw145LYj20zU--tXhqR3Oj3Z3ZYQIL96r-qVS8Wck5MWooViD8UxYoufjW0v9kcc9Ya_ticvLg69QSsu1vBlEJDtgByB7NIEublqZRhHKPZvATbxzCbTX1Acgdaz9xcXOLQD2k3Sz0ufDOYFaKfUz_snvljzQwweaDdKJRzQLk0JadKiBtp9lKYNXmc5zCj1oBYuHEJJLsK7wXkr9ZTMUBKgh3CcDIrpKR6NfWE-TosbwjT_DVoGNNtvDmmCdtEh6kEC49j5VyUgO4ZyIds9JsF3xWBabBXdlbMnyuV_KpePyuV75TwJqlyO45r0jicbur2_z9Khm82iON46i34WOBqlzFXqCRd9ZdoLjkHozi3J9oSz7SiO480aaSihWUyyOK0xrSHbkSq8ihuV7rdnK-dZNL1F5wRygnFe5UAPFQLdv_2u0BaGQDM54tfQjj-Y2y9SeamB1udzv_2fnbfDbIE2NwYi0N2AkB0RaD3MzIYDoM1HSs3CkPSBe29tSCiUEzfvT8X-RSK0YKPh54hrbs3l-OZk9d0tevDS6G_CLzZ4__rl--lwPv15OHw5nd4LVMeHe_x1JDpj0YpRWKEHgUar18dbvxvI8cPI_hTWSaO3iF9RvCHh2knyVKL4XxJFQpLqt0VFvM14kzUsEm1aVk1aNHVZRXNLhrphnI6sSvO8pEPZFwXnZMw5LbKGNpFswySSLK3TKq3yKml41peC5mWejrzpBeREvDCpkrClEmOnSDq3iLZM86aOFOuFcuvypFSLK64gUBp2qW3XzdYvk4OcKOm8-0fFS69E-01MVrjVntT4pHOQddFiVfvpTboWE1bpWuzfAQAA__8fH7fH">