Page MenuHomePhabricator

[clang-format] Don't align too long broken trailing comments

Authored by krasimir on Jun 2 2017, 6:55 AM.



This patch fixes a bug where clang-format will align newly broken trailing
comments even if this will make them exceed the line limit. The bug was caused
by a combination of unsigned arithmetic overflow and an imprecise computation
of the length of broken comment lines.

Diff Detail


Event Timeline

krasimir created this revision.Jun 2 2017, 6:55 AM
alexfh accepted this revision.Jun 2 2017, 9:05 AM
This revision is now accepted and ready to land.Jun 2 2017, 9:05 AM
This revision was automatically updated to reflect the committed changes.
pboettch added a subscriber: pboettch.EditedAug 19 2017, 5:57 AM

Could this be, that this commit doesn't handle well ColumnLimit: 0? With my style based on LLVM and ColumnLimit: 0 I had comments and consecutive lines aligned before, not anymore with

clang-format version 5.0.0-+rc2-1 (tags/RELEASE_500/rc2)

from Debian testing.

@pboettch: It's possible. Please file a bug with an example.