[clang] [clang-format] Add xxxMaxDigitsNoSeparator (PR #164286)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 3 11:33:51 PST 2025


HazardyKnusperkeks wrote:

> When I designed [`IntegerLiteralSeparator`](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#integerliteralseparator), I included "if negative, remove separators" for completeness because of the virtually zero overhead, even though I didn't think anyone would use it. After I added `BinaryMinDigits`, etc. integer literals having fewer digits than the minimum would have all separators removed. I guess you are trying to set a maximum number of digits for removing separators?

I want to add a range, where I have the choice if there are separators, or not. Yes that sets an upper bound to where they are removed, but in the same time opens a window where clang-format ensures the separators are up to code, if there is at least one before formatting, but doesn't add them, if there weren't any.

https://github.com/llvm/llvm-project/pull/164286


More information about the cfe-commits mailing list