[clang] [clang-format] add option to control bin-packing keyworded parameters (PR #131605)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 28 09:50:43 PDT 2025


================
@@ -3276,6 +3276,45 @@ struct FormatStyle {
   /// \version 20
   bool KeepFormFeed;
 
+  /// Function-like declaration with keyworded parameters.
+  /// Lists possible keywords for a named function-like macro.
+  struct KeywordedFunctionLikeMacro {
+    std::string Name;
+    std::vector<std::string> Keywords;
+
+    bool operator==(const KeywordedFunctionLikeMacro &Other) const {
+      return Name == Other.Name && Keywords == Other.Keywords;
+    }
+  };
+
+  /// Allows to format function-like macros with keyworded parameters according
+  /// to the BinPackParameters setting, treating keywords as parameter
+  /// sepratators.
----------------
HazardyKnusperkeks wrote:

```suggestion
  /// separators.
```


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


More information about the cfe-commits mailing list