-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang-format] Unstable output with AllowShortFunctionsOnASingleLine=inline #102937
Labels
Comments
This test does not produce oscillating behavior but still takes two runs to converge void f() {
#define M(x) \
return {#x};
} becomes void f() {
#define M(x) \
return { \
#x \
};
} which then becomes void f() {
#define M(x) return {#x};
} Macro parameter |
owenca
added a commit
to owenca/llvm-project
that referenced
this issue
Aug 13, 2024
owenca
added a commit
that referenced
this issue
Aug 13, 2024
llvmbot
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Aug 13, 2024
…vm#102998) Fixes llvm#102937. (cherry picked from commit ee23599)
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Aug 15, 2024
…vm#102998) Fixes llvm#102937. (cherry picked from commit ee23599)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Somewhat minified test case:
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 (1️⃣🔄2️⃣).Output 1:
Output 2:
It is a regression in clang-format-18, 17 works fine. Issue is still present in clang-format-19, did not check with trunk.
The text was updated successfully, but these errors were encountered: