Skip to content

Clang-format: Correctly align macros with trailing multiline comment #54399

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

Open
fulcrumEFX opened this issue Mar 16, 2022 · 1 comment
Open

Comments

@fulcrumEFX
Copy link

fulcrumEFX commented Mar 16, 2022

Hello,
When formatting macros, those who have trailing multiline comments are formatted incorrectly (moved into new line):

#define FOO_1   BAR_1   /* Comment */
#define FOO_2   BAR_2   /* Comment */
#define FOO_3   BAR_3   /* Multiline
                           Comment */
#define FOO_4   BAR_4   /* Comment */

gets formatted to:

#define FOO_1 BAR_1 /* Comment */
#define FOO_2 BAR_2 /* Comment */
#define FOO_3                    \
  BAR_3             /* Multiline \
                     * Comment */
#define FOO_4 BAR_4 /* Comment */

Tested with clang-format 13.0.0 and 13.0.1 with custom .clang-format based on LLVM and also LLVM only

Perhaps related to #53180 ?

Greetings

@llvmbot
Copy link
Member

llvmbot commented Mar 16, 2022

@llvm/issue-subscribers-clang-format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants