This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Handle attributes in enum declaration.
ClosedPublic

Authored by tchatow on May 17 2022, 9:19 PM.

Details

Summary

Fixes https://github.com/llvm/llvm-project/issues/55457

Ensures that attributes in the enum declaration are interpreted
correctly, for instance:

enum class [[nodiscard]] E {
  a,
  b
};

Diff Detail

Event Timeline

tchatow created this revision.May 17 2022, 9:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 9:19 PM
tchatow requested review of this revision.May 17 2022, 9:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 9:19 PM
tchatow edited the summary of this revision. (Show Details)May 18 2022, 5:20 PM
tchatow added a reviewer: MyDeveloperDay.
MyDeveloperDay edited projects, added Restricted Project; removed Restricted Project.
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 8:45 AM
MyDeveloperDay accepted this revision.May 23 2022, 8:46 AM

This looks good to me, but let the others chime in..

This revision is now accepted and ready to land.May 23 2022, 8:46 AM

Could you please add test cases with non-empty enums both with and without comments please like in the bug report?

tchatow updated this revision to Diff 431489.May 23 2022, 2:53 PM

Added tests for non-empty enums

curdeius accepted this revision.May 25 2022, 11:32 AM

LGTM. Thanks a lot!
Do you have commit rights or need some help landing this?

No, I'll need someone to commit it on my behalf.

This revision was automatically updated to reflect the committed changes.