[clang] [clang-format] Add PackParameters enum option to replace BinPackParameters. (PR #101882)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 4 11:50:25 PDT 2024


================
@@ -1174,6 +1192,18 @@ template <> struct MappingTraits<FormatStyle> {
         Style.PackConstructorInitializers = FormatStyle::PCIS_CurrentLine;
     }
 
+    // If BinPackParameters was specified but PackParameters was not, initialize
+    // the latter from the former for backwards compatibility.
+    if (IsChromiumOrMozilla) {
+      if (BinPackParameters &&
+          (Style.PackParameters == FormatStyle::PPS_CurrentLine)) {
+        Style.PackParameters = FormatStyle::PPS_BinPack;
+      }
+    } else if (!BinPackParameters &&
+               (Style.PackParameters == FormatStyle::PPS_BinPack)) {
----------------
HazardyKnusperkeks wrote:

```suggestion
               Style.PackParameters == FormatStyle::PPS_BinPack) {
```

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


More information about the cfe-commits mailing list