Skip to content

[clang-format] RemoveSemicolon: true does not remove semicolon at the end of empty function #79833

Closed
@CDAlexanderW

Description

@CDAlexanderW

Environment

The tested v18 clang-format executable was built from latest source of 15.01.2024.

Setting in .clang-format is:

Language: Cpp
RemoveSemicolon: true

Problem

RemoveSemicolon: true does not remove semicolon at the end of constructor/destructor:

class A {
  ~A(){};
  void s() {};
};

When adding something (in that case int i;) into the implementation, it seems to work and the semicolons after } get removed:

class A {
  ~A() { int i; }
  void s() { int i; }
};

It looks like #58251 mentions clang-format "cannot determine {} as an empty function".

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions