[clang] [clang-format] Add xxxMaxDigitsNoSeparator (PR #164286)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 18 06:25:44 PST 2025
================
@@ -243,6 +243,22 @@ TEST_F(IntegerLiteralSeparatorTest, FloatingPoint) {
Style);
}
+TEST_F(IntegerLiteralSeparatorTest, MaxDigitsNoSeparator) {
+ auto Style = getLLVMStyle();
+ Style.IntegerLiteralSeparator.Decimal = 3;
+ Style.IntegerLiteralSeparator.DecimalMaxDigitsNoSeparator = 4;
+ Style.IntegerLiteralSeparator.DecimalMinDigits = 7;
+ verifyFormat("d0 = 2023;\n"
+ "d1 = 123456;\n"
+ "d2 = 123'456;\n"
+ "d3 = 5'000'000;",
+ "d0 = 20'2'3;\n"
+ "d1 = 123456;\n"
+ "d2 = 1234'56;\n"
----------------
HazardyKnusperkeks wrote:
Why? I think minimizing the calls to format will be beneficial for the enormous runtime. And as long as they are not broken, there's no benefit.
https://github.com/llvm/llvm-project/pull/164286
More information about the cfe-commits
mailing list