-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Clang format breaks macro by removing new lines #42087
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
Comments
It is definitely related to brace wrapping, as I can reproduce it on current main (2022-02-02) with config:
or
and smaller reproducer:
|
FWIW, I have a quick fix that prevents merging together the two macro definitions (and hence the code does not break anymore), but the formatting is strange.
becomes
Config as above:
This partial fix is to add:
at the beginning of |
Revision URI: https://reviews.llvm.org/D118879. |
The l_brace token in a macro definition should not be set to TT_FunctionLBrace. This patch could have fixed #42087. Differential Revision: https://reviews.llvm.org/D118969
Fixes llvm/llvm-project#42087. Reviewed By: HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D118879
Uh oh!
There was an error while loading. Please reload this page.
Extended Description
The following macros become inlined and so cannot be compiled:
becomes:
Header and .clang-format attached
The text was updated successfully, but these errors were encountered: