Skip to content

[clang-format] RemoveSemicolon spuriously removing semicolon with trailing requires #155746

@rmarker

Description

@rmarker

Tested on main (595573d), with the RemoveSemicolon option enabled.

The following code

template <typename Foo>
void Fun(const Foo &F)
  requires requires(Foo F) {
    { F.Bar() } -> std::same_as<int>;
  };

is formatted to

template <typename Foo>
void Fun(const Foo &F)
  requires requires(Foo F) {
    { F.Bar() } -> std::same_as<int>;
  }

Specifically, it incorrectly removes the semicolon at the end.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions