This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] ColumnLimit check for trailing comments alignment acts wrong for multi-byte UTF-8 #47624
AbandonedPublic

Authored by HazardyKnusperkeks on Apr 22 2022, 7:20 AM.

Details

Summary

Fix for
https://github.com/llvm/llvm-project/issues/47624
https://bugs.llvm.org/show_bug.cgi?id=48280

Used token for counting length instead of logical symbols.
That leads to wrong length count with utf8 symbols

Diff Detail

Event Timeline

StailGot created this revision.Apr 22 2022, 7:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 7:20 AM
StailGot requested review of this revision.Apr 22 2022, 7:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 7:20 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
StailGot edited the summary of this revision. (Show Details)Apr 22 2022, 7:26 AM

Hi,

could you please reupload your patch with the full diff context? And please add a regression test.

HazardyKnusperkeks requested changes to this revision.Apr 22 2022, 1:22 PM
This revision now requires changes to proceed.Apr 22 2022, 1:22 PM
StailGot updated this revision to Diff 424749.Apr 23 2022, 2:12 PM
StailGot updated this revision to Diff 424754.Apr 23 2022, 5:10 PM

Hi,

could you please reupload your patch with the full diff context? And please add a regression test.

Done!

There seem to be failing tests. Did you run the FormatTests?

clang/unittests/Format/FormatTestComments.cpp
2861–2864

Here is something wrong.

Do you still intend to work on this? Otherwise I will commandeer and abandon.

HazardyKnusperkeks commandeered this revision.Nov 3 2022, 5:51 AM
HazardyKnusperkeks abandoned this revision.
HazardyKnusperkeks edited reviewers, added: StailGot; removed: HazardyKnusperkeks.

You can reopen this, if you wish to continue working on it.