Fixes issues introduced by newer clang-format versions or commits pushed directly without using the clang-format pre-commit hook.
Fixes #12973.