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

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 11:17:24 PST 2021


HazardyKnusperkeks planned changes to this revision.
HazardyKnusperkeks added inline comments.


================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:2243
           Reflow = true;
           if (ContentStartColumn + RemainingTokenColumns > ColumnLimit) {
             LLVM_DEBUG(llvm::dbgs()
----------------
curdeius wrote:
> Is this condition on `ColumnLimit` (and other below) working ok when `ColumnLimit == 0`? Do your tests cover it?
I must admit, that I don't know for sure.
Line comments should be checked, and a string literal on one line is also covered (that's how I found that I have to disable the inner loop). I should add a new test case with multiline comments and multiline string literals.

But I think your proposal of using `::max()` is sound and should be used.


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