This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] New BreakInheritanceList style AfterComma
ClosedPublic

Authored by lichray on May 26 2021, 1:43 PM.

Details

Summary

This inheritance list style has been widely adopted by Symantec,
a division of Broadcom Inc. It breaks after the commas that
separate the base-specifiers:

class Derived : public Base1,
                private Base2
{
};

Diff Detail

Event Timeline

lichray requested review of this revision.May 26 2021, 1:43 PM
lichray created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2021, 1:43 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
lichray added a project: Restricted Project.
lichray updated this revision to Diff 348092.May 26 2021, 2:10 PM

Fix typo in docs.

lichray updated this revision to Diff 348164.May 26 2021, 10:40 PM

Simplify implementation.

lichray retitled this revision from [Format] New BreakInheritanceList style AfterComma to [clang-format] New BreakInheritanceList style AfterComma.May 26 2021, 10:45 PM
MyDeveloperDay requested changes to this revision.May 27 2021, 3:17 AM
MyDeveloperDay added a subscriber: MyDeveloperDay.

Adding such a feature like this needs unit tests, it won't be let in without them, you need to add them to clang/unittest/Format/Format.cpp

You also need to update the ReleaseNotes.rst to mention this.

This revision now requires changes to proceed.May 27 2021, 3:17 AM
HazardyKnusperkeks added inline comments.
clang/include/clang/Format/Format.h
1839

Maybe add a comma, so that the next addition will not need to modify this line?

lichray updated this revision to Diff 348423.May 27 2021, 5:31 PM

Add tests and update the release notes.

lichray marked an inline comment as done.May 27 2021, 5:33 PM

Adding such a feature like this needs unit tests, it won't be let in without them, you need to add them to clang/unittest/Format/Format.cpp

You also need to update the ReleaseNotes.rst to mention this.

Done.

lichray added inline comments.May 27 2021, 5:34 PM
clang/include/clang/Format/Format.h
1839

Sure.

lichray updated this revision to Diff 348424.May 27 2021, 5:47 PM

Correct a copy-pasted test case.

This revision is now accepted and ready to land.May 28 2021, 5:15 AM
curdeius accepted this revision.May 28 2021, 12:31 PM
curdeius added a subscriber: curdeius.

LGTM.

This revision was landed with ongoing or failed builds.May 28 2021, 4:24 PM
This revision was automatically updated to reflect the committed changes.