This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fix RAS reference alignment when PAS is left or middle
ClosedPublic

Authored by gedare on Jun 22 2023, 12:12 PM.

Details

Summary

Fixes a bug with the handling of right aligned references with left/middle alignment pointers.

Addresses Issue #63452.

https://github.com/llvm/llvm-project/issues/63452

Diff Detail

Event Timeline

gedare created this revision.Jun 22 2023, 12:12 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptJun 22 2023, 12:12 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
gedare requested review of this revision.Jun 22 2023, 12:12 PM
gedare edited the summary of this revision. (Show Details)Jun 22 2023, 12:13 PM

Could you please split this into two reviews?

gedare updated this revision to Diff 533745.Jun 22 2023, 1:04 PM
gedare edited the summary of this revision. (Show Details)

Split and keep right-aligned references, will put function pointers in new rev

gedare retitled this revision from [clang-format] Align consecutive function pointers and references to [clang-format] Fix RAS reference alignment when PAS is left or middle.Jun 22 2023, 1:06 PM
gedare edited the summary of this revision. (Show Details)

Could you please split this into two reviews?

yes, done, will stage the other review soon. The function pointer alignment requires this fix for the formatting to be correct inside of the nested scope of the function pointer parameters.

This revision is now accepted and ready to land.Jun 24 2023, 3:43 AM
MyDeveloperDay accepted this revision.Jun 26 2023, 1:43 AM
owenpan added inline comments.Jun 26 2023, 5:30 PM
clang/lib/Format/WhitespaceManager.cpp
459

See below.

463–466

Shorter and IMO easier to follow.

gedare updated this revision to Diff 537363.Jul 5 2023, 8:28 AM
gedare edited the summary of this revision. (Show Details)

Use suggested shorter logic

gedare requested review of this revision.Jul 5 2023, 8:28 AM
gedare marked 2 inline comments as done.
owenpan accepted this revision.Jul 5 2023, 12:42 PM
This revision is now accepted and ready to land.Jul 5 2023, 12:42 PM