This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fix invalid-code-generation by RemoveBracesLLVM
ClosedPublic

Authored by owenpan on Jul 14 2022, 1:30 AM.

Details

Summary

When removing an r_brace that is the first token of an annotated line, if the
line above ends with a line comment, clang-format generates invalid code by
merging the tokens after the r_brace into the line comment.

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

Diff Detail

Event Timeline

owenpan created this revision.Jul 14 2022, 1:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 1:30 AM
owenpan requested review of this revision.Jul 14 2022, 1:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 1:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
curdeius accepted this revision.Jul 14 2022, 8:34 AM
This revision is now accepted and ready to land.Jul 14 2022, 8:34 AM
This revision was landed with ongoing or failed builds.Jul 14 2022, 3:20 PM
This revision was automatically updated to reflect the committed changes.