This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Do not remove required spaces when aligning tokens.
ClosedPublic

Authored by curdeius on Feb 10 2022, 2:01 AM.

Diff Detail

Event Timeline

curdeius requested review of this revision.Feb 10 2022, 2:01 AM
curdeius created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2022, 2:01 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
curdeius added inline comments.Feb 10 2022, 2:09 AM
clang/lib/Format/WhitespaceManager.cpp
334–337

On a second thought, it seems like a workaround only and a real solution would be to fix https://github.com/llvm/llvm-project/issues/53699 that I've just created.
It fixes an immediate problem though.
I'll add a fixme in a later revision (or when landing) to remove this when the abovementioned bug is solved properly.
Then, this problem should be caught by the assertion added later below.

owenpan accepted this revision.Feb 10 2022, 2:22 AM
owenpan added inline comments.
clang/lib/Format/WhitespaceManager.cpp
409
clang/unittests/Format/FormatTest.cpp
17287
17298
This revision is now accepted and ready to land.Feb 10 2022, 2:22 AM
curdeius updated this revision to Diff 407442.Feb 10 2022, 2:41 AM
curdeius marked 3 inline comments as done.

Address review comments. Add a fixme note.