-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Closed
Labels
Description
| Bugzilla Link | 41870 |
| Resolution | FIXED |
| Resolved on | Apr 21, 2021 00:51 |
| Version | unspecified |
| OS | other |
| Attachments | Files to reproduce bug |
| Reporter | LLVM Bugzilla Contributor |
| CC | @MaxSagebaum |
Extended Description
#Description
Inconsistent behavior regarding line break before access modifier.
If a newline exists it gets removed. If no newline exists it gets added.
Similar but not quite the same: #16892
#How to reproduce:
clang-format --style=file example.hpp > example_after.hpp
##.clang-format
MaxEmptyLinesToKeep: 0
##example.hpp
class a {
public:
void b();
public: // newline gets inserted
void c();
public: // newline gets removed
void d();
}
##example_after.hpp
class a {
public:
void b();
public: // newline gets inserted
void c();
public: // newline gets removed
void d();
}