This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fix a bug in AlignConsecutiveDeclarations
ClosedPublic

Authored by owenpan on Apr 27 2019, 2:08 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

owenpan created this revision.Apr 27 2019, 2:08 AM
This revision is now accepted and ready to land.Apr 27 2019, 5:09 AM
owenpan planned changes to this revision.Apr 27 2019, 4:18 PM

Tested it a bit more and found another problem. The code

DECOR1 uint32_t DECOR2 function1 (int arg1, int arg2) { return 1U; }
DECOR1 unsigned DECOR2 function2 (int arg1, int arg2) { return 1U; }

would still be misformatted to:

DECOR1 uint32_t DECOR2
       function1(int arg1, int arg2) { return 1U; }
DECOR1 unsigned DECOR2
function2(int arg1, int arg2) { return 1U; }
owenpan updated this revision to Diff 196994.Apr 27 2019, 5:07 PM
owenpan retitled this revision from [clang-format] Fix bug in determineTokenType() for TT_StartOfName to [clang-format] Fix a bug in AlignConsecutiveDeclarations.

Fix it in WhitespaceManager::alignConsecutiveDeclarations() instead.

This revision is now accepted and ready to land.Apr 27 2019, 5:07 PM
owenpan requested review of this revision.Apr 27 2019, 5:13 PM
This revision is now accepted and ready to land.May 1 2019, 4:40 AM
owenpan updated this revision to Diff 197566.May 1 2019, 11:19 AM

Removed a redundant test case.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2019, 11:21 AM