Skip to content

Inconsistent behavior regarding line break before access modifier. #41215

@llvmbot

Description

@llvmbot
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();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions