[PATCH] D96896: [clang-format] Respect spaces in line comment section without an active column limit

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 09:10:05 PST 2021


curdeius added a comment.

It seems to be a bug indeed.
So, basically all the changes are just adding a bunch of conditions on `ColumnLimit != 0` which is a special value meaning "no limit", right? Or have I missed something?
Thining out loud... wouldn't it be easier to change `ColumnLimit` from 0 to `numeric_limits<unsigned>::max()` just before these transformations?



================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:2243
           Reflow = true;
           if (ContentStartColumn + RemainingTokenColumns > ColumnLimit) {
             LLVM_DEBUG(llvm::dbgs()
----------------
Is this condition on `ColumnLimit` (and other below) working ok when `ColumnLimit == 0`? Do your tests cover it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96896/new/

https://reviews.llvm.org/D96896



More information about the cfe-commits mailing list