Issue 61498
Summary Regression in clang-format version 16?
Labels new issue
Assignees
Reporter prj-
    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
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to