-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang-format] Bug when formatting a macro #76991
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
Labels
clang-format
invalid-code-generation
Tool (e.g. clang-format) produced invalid code that no longer compiles
Comments
Is there something I could do to help get this bug fixed? |
@owenca, any update on this? |
A minimum reproducer would help. :) |
Here's one:
|
owenca
added a commit
to owenca/llvm-project
that referenced
this issue
Jan 22, 2024
Thank you very much. |
owenca
added a commit
that referenced
this issue
Jan 23, 2024
I've found out that this bug can be worked around by adding a trailing comma to the last element in the list, i.e. formatting #define FOO \
int foo[][2] = { \
{0, 1}, \
}; should work fine. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang-format
invalid-code-generation
Tool (e.g. clang-format) produced invalid code that no longer compiles
Also triggered by
Debian clang-format version 18.0.0 (++20240102111311+9b7cf5bfb08b-1~exp1~20240102111413.1794)
.clang-format.txt
The text was updated successfully, but these errors were encountered: