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] RemoveSemicolon: true does not remove semicolon at the end of empty function #79833

Closed
CDAlexanderW opened this issue Jan 29, 2024 · 0 comments · Fixed by #82278
Assignees

Comments

@CDAlexanderW
Copy link

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".

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

Successfully merging a pull request may close this issue.

2 participants