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 removes empty line at end of file #56054

Closed
GeorgWeinhold opened this issue Jun 15, 2022 · 5 comments
Closed

Clang-Format removes empty line at end of file #56054

GeorgWeinhold opened this issue Jun 15, 2022 · 5 comments

Comments

@GeorgWeinhold
Copy link

For C and C++ an empty line at the end of each file (header and implementation) is mandatory.

clang format does not add this new line. Moreover, clang-format removes existing empty line at the and of files.

This leads to compiler warnings.

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 15, 2022

@llvm/issue-subscribers-clang-format

@mkurdej
Copy link
Member

mkurdej commented Jun 16, 2022

Can you give a reproducer in which clang-format removes the existing empty line, please?

@XobSod
Copy link

XobSod commented Sep 26, 2022

I have this problem too:
echo "namespace aaa {}\n\n" | clang-format

@rongcuid
Copy link

I also have this problem

@owenca
Copy link
Contributor

owenca commented Jun 6, 2023

@owenca owenca closed this as completed in d2627cf Jun 7, 2023
@github-actions github-actions bot removed the awaiting-review Has pending Phabricator review label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants