[clang] [clang-format] Add an option to format integer and float literal case (PR #151590)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 13 23:24:47 PDT 2025


================
@@ -47,14 +47,21 @@ TEST_F(NumericLiteralInfoTest, IntegerLiteral) {
   // Hexadecimal.
   EXPECT_TRUE(verifyInfo(NumericLiteralInfo("0xF"), 1));
   EXPECT_TRUE(verifyInfo(NumericLiteralInfo("0XfZ"), 1, npos, npos, 3));
+
+  // C++ suffixes.
+  EXPECT_TRUE(verifyInfo(NumericLiteralInfo("1if"), npos, npos, npos, 1));
+  EXPECT_TRUE(verifyInfo(NumericLiteralInfo("123_felt_pen"), npos, npos, npos, 3));
----------------
owenca wrote:

Why the new test cases for `NumericLiteralInfo`? If they test non-trivial code paths not already covered by the existing tests, please add them in a separate patch.

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


More information about the cfe-commits mailing list