Skip to content

Clang-format IntegerLiteralSeparator too strict #61209

@JVApen

Description

@JVApen

When using IntegerLiteralSeparator with a Decimal digit separator at '3', you get a digit separator once your integer has a 4th digit.
However, consider the following case:

auto today = std::chrono::year_month_day{2023, 3, 6};

due to this guideline, it gets transformed into:

auto today = std::chrono::year_month_day{2'023, 3, 6};

Although correct according to the configuration, it does not improve the readability of that code.
Would it be possible to next to Decimal have an option MinDigitDecimal which is used to check if we have sufficient digits before this transformation is needed? For the value 5, it would require 10'000, though not 1'000.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions