Skip to content
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] [regression] formatting of macro not stable; oscillates between two ways #106418

Closed
joelhock opened this issue Aug 28, 2024 · 4 comments · Fixed by #106662 or #107352
Closed

Comments

@joelhock
Copy link

formatting of the MEMBER macro oscillates between the two ways shown below each time it is reformatted with 19.1.0-rc3 and also main as of 114ff99. version 18 consistently chose the first one, fwiw.

empty .clang-format

struct MyStruct : Base {
  int foo;

#define MEMBER(NAME)                                                           \
  NAME { "" }
  MEMBER(bar);
};

struct MyStruct : Base {
  int foo;

#define MEMBER(NAME) NAME{""}
  MEMBER(bar);
};
@owenca
Copy link
Contributor

owenca commented Aug 29, 2024

version 18 consistently chose the first one, fwiw.

Which version of 18?

@owenca owenca self-assigned this Aug 29, 2024
@joelhock
Copy link
Author

ah, sorry, what I said wasn't correct. version 17.0.1 (e19b7dc) stably formatted this code, but version 18 and 19 do not.

@owenca
Copy link
Contributor

owenca commented Aug 31, 2024

Bisected it to 063e3fe.

version 18 consistently chose the first one, fwiw.

version 17.0.1 (e19b7dc) stably formatted this code, but version 18 and 19 do not.

Actually, version 17.0.1 consistently chose the second one.

@owenca owenca closed this as completed in 0fa78b6 Sep 2, 2024
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Sep 3, 2024
tru pushed a commit to llvmbot/llvm-project that referenced this issue Sep 3, 2024
@owenca
Copy link
Contributor

owenca commented Sep 4, 2024

0fa78b6 has been reverted by 3449ed8.

@owenca owenca reopened this Sep 4, 2024
owenca added a commit to owenca/llvm-project that referenced this issue Sep 5, 2024
@owenca owenca closed this as completed in 616a8ce Sep 6, 2024
VitaNuo pushed a commit to VitaNuo/llvm-project that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment