Fixes https://llvm.org/PR41870.
Checks for newlines in option Style.EmptyLineBeforeAccessModifier are now based on the formatted new lines and not on the new lines in the file.
Paths
| Differential D99503
[clang-format] Inconsistent behavior regarding line break before access modifier ClosedPublic Authored by Max_S on Mar 29 2021, 6:28 AM.
Details Summary Fixes https://llvm.org/PR41870. Checks for newlines in option Style.EmptyLineBeforeAccessModifier are now based on the formatted new lines and not on the new lines in the file.
Diff Detail
Event Timelinelebedev.ri retitled this revision from Fixes for bug 41870. to [clang-format] Fixes for bug 41870..Mar 29 2021, 6:36 AM MyDeveloperDay retitled this revision from [clang-format] Fixes for bug 41870. to [clang-format] Inconsistent behavior regarding line break before access modifier. Comment Actionscan you clang-format so it passes the pre-merge checks
Comment Actions Look good in general, only the few comments.
This revision is now accepted and ready to land.Apr 15 2021, 3:27 AM Comment Actions I do not have the access rights to the llvm git repo. Can you please land it for me. Thanks and thank you for the review. Comment Actions I don't know if you did elsewhere, but you have to give a name and email for the commit, so that someone can push it for you. Comment Actions Sorry for the inconvenience. These were the errors, that inspired this patch. In all cases the new version is now the correct one. The default setting of EmptyLineBeforeAccessModifier is to insert empty lines for logical blocks, which it does now. Closed by commit rGfd4e08aa8f7e: [clang-format] Inconsistent behavior regarding line break before access modifier (authored by Max_S, committed by curdeius). · Explain WhyApr 16 2021, 1:39 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 338024 clang/docs/ReleaseNotes.rst
clang/lib/Format/UnwrappedLineFormatter.cpp
clang/unittests/Format/FormatTest.cpp
|
While we are at empty lines, maybe add some here, so that it is a bit more readable. It took me some time to see that you use 2 different styles.