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

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 25 23:10:06 PDT 2025


================
@@ -472,6 +473,25 @@ struct ScalarEnumerationTraits<FormatStyle::NamespaceIndentationKind> {
   }
 };
 
+template <>
+struct ScalarEnumerationTraits<FormatStyle::NumericLiteralComponentStyle> {
+  static void enumeration(IO &IO,
+                          FormatStyle::NumericLiteralComponentStyle &Value) {
+    IO.enumCase(Value, "Leave", FormatStyle::NLCS_Leave);
+    IO.enumCase(Value, "Upper", FormatStyle::NLCS_Upper);
+    IO.enumCase(Value, "Lower", FormatStyle::NLCS_Lower);
+  }
+};
+
+template <> struct MappingTraits<FormatStyle::NumericLiteralCaseStyle> {
+  static void mapping(IO &IO, FormatStyle::NumericLiteralCaseStyle &Base) {
----------------
owenca wrote:

```suggestion
  static void mapping(IO &IO, FormatStyle::NumericLiteralCaseStyle &Value) {
```

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


More information about the cfe-commits mailing list