The following simple .clang-format file, defining a CASE macro, results in a hang when trying to format the following simple poc.cc file.
$ cat .clang-format
Macros:
- CASE=case
$ cat poc.cc
int f() {
switch (42) {
#define CASE(kind)
CASE(1)
CASE(2)
#undef CASE
}
}
$ ./clang-format -version
clang-format version 21.1.3 (https://github.com/llvm/llvm-project 450f52eec88f728c89a9efd667dbeaf2dad93826)
$ ./clang-format poc.cc
^Cinterrupted