Issue 102937
Summary [clang-format] Unstable output with AllowShortFunctionsOnASingleLine=inline
Labels clang-format
Assignees
Reporter vient
    Somewhat minified test case:
```cpp
auto f() {
#define M(x)     \
  case x: {      \
    return {#x}; \
  }
}
```
Formatting it with `clang-format-18 -Werror --style='{AllowShortFunctionsOnASingleLine: Inline}'` results in oscillating outputs - original code produces output 1, it produces output 2, which produces output 1, and so on.
Output 1:
```cpp
auto f() {
#define M(x) \
  case x: { \
    return { \
      #x \
    }; \
 }
}
```
Output 2:
```cpp
auto f() {
#define M(x) \
  case x: { \
 return {#x}; \
  }
}
```

It is a regression in clang-format-18, 17 works fine. Issue is still present in clang-format-19, did not check with trunk.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to