Skip to content

[clang-format] odd line break with c-style comment in argument list #86573

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
joelhock opened this issue Mar 25, 2024 · 1 comment · Fixed by #88414
Closed

[clang-format] odd line break with c-style comment in argument list #86573

joelhock opened this issue Mar 25, 2024 · 1 comment · Fixed by #88414

Comments

@joelhock
Copy link

version 17.0.1 consistently keeps a c-style comment with its argument:

void func() {
  fooooooooooooooooooooooooooooooooooooooo(
      a,
      /*qqqq_=*/std::move(q), [this, b](std::function<void(uint32_t)> cb) {},
      c);
  fooooooooooooooooooooooooooooooooooooooo(
      /*qqqq_=*/std::move(q), [this, b](std::function<void(uint32_t)> cb) {});
  fooooooooooooooooooooooooooooooooooooooo(
      /*qqqq_=*/std::move(q), [this, b](std::function<void(uint32_t)> cb) {},
      c);
}

whereas 18.1 and HEAD (d99cfa0) in one narrow case decides to break after the comment (the last function call in this example):

void func() {
  fooooooooooooooooooooooooooooooooooooooo(
      a,
      /*qqqq_=*/std::move(q), [this, b](std::function<void(uint32_t)> cb) {},
      c);
  fooooooooooooooooooooooooooooooooooooooo(
      /*qqqq_=*/std::move(q), [this, b](std::function<void(uint32_t)> cb) {});
  fooooooooooooooooooooooooooooooooooooooo(
      /*qqqq_=*/
      std::move(q), [this, b](std::function<void(uint32_t)> cb) {}, c);
}
@owenca
Copy link
Contributor

owenca commented Mar 28, 2024

Bisected to d06b923. @jp4a50

@owenca owenca self-assigned this Apr 11, 2024
owenca added a commit to owenca/llvm-project that referenced this issue Apr 11, 2024
Commit d06b923 caused a regression that breaks after a block comment
adjacent to a function paramter that follows.

Fixes llvm#86573.
owenca added a commit that referenced this issue Apr 12, 2024
Commit d06b923 caused a regression that breaks after a block
comment adjacent to a function paramter that follows.

Fixes #86573.
bazuzi pushed a commit to bazuzi/llvm-project that referenced this issue Apr 15, 2024
Commit d06b923 caused a regression that breaks after a block
comment adjacent to a function paramter that follows.

Fixes llvm#86573.
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Apr 19, 2024
Commit d06b923 caused a regression that breaks after a block
comment adjacent to a function paramter that follows.

Fixes llvm#86573.

(cherry picked from commit d61edec)
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Apr 26, 2024
Commit d06b923 caused a regression that breaks after a block
comment adjacent to a function paramter that follows.

Fixes llvm#86573.

(cherry picked from commit d61edec)
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants