-
Notifications
You must be signed in to change notification settings - Fork 10.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
Wrong formatting of labels in preprocessor lines #92300
Comments
Incidentally, I'm wondering whether the first example wouldn't be better with a formatting like:
|
@llvm/issue-subscribers-clang-format Author: Julien ÉLIE (Julien-Elie)
Contrary to previous versions, clang-format 18 reformats:
as:
I don't think it is the expected output. Previous versions of clang-format kept it unchanged. It looks like |
Which version(s)? And what's your .clang-format file? |
Hi @owenca, thanks for having taken a look at this bug report. I see that you even already provided fixes. Thanks! FWIW, my
The previous version I was using is Clang 17.0.6 which had not the issue, nor versions 16, 15, 14, etc. (but I do not remember the exact releases I used for them). |
@Julien-Elie I asked which version and what configuration you used because I couldn't make clang-format keep your example unchanged.
However, if I put your example in a
|
Maybe, but see the example for |
Oh yes, thanks for your answer. |
@Julien-Elie it has to be a new |
) Fixes llvm#92300. (cherry picked from commit d89f200)
Contrary to previous versions, clang-format 18 reformats:
as:
I don't think it is the expected output. Previous versions of clang-format kept it unchanged. It looks like
:
is now interpreted as a colon in a ternary operation instead of a colon following a label name.The text was updated successfully, but these errors were encountered: