Do formatting on the 2nd function only: ```cpp int a() { return 0; } int b() { return 0; } ``` with a command line like "clang-format test.cpp --style="Mozilla" --lines=5:10" and it works with clang 14. The bug repros with other styles too. A similar (or the same issue) was reported at https://github.com/llvm/llvm-project/issues/58464 with slightly different repro code, but the root cause could be the same.