You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possible bugfix
Reproduces on
OS: Fedora
Clang version: 11.0 and 12.0
The problem is that, Newlines is set to 1 because of the setting MaxEmptyLinesToKeep. The checks in the logic are based on RootToken.NewlinesBefore which is 2 and therefore Newlines is not changes. The checks need to be changed to the actual value of Newlines.
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();
}
The text was updated successfully, but these errors were encountered: