Inconsistent behaviour in clang-format-19 (original) (raw)

Hi! I am using clang-format-19 (experimental package in Debian).

Independently of what my settings are… I found this formatting a little strange:

// Before
  void set(PrecisePoint origin, Real x_orientation, PreciseVector y, PreciseVector z);
  void set(PrecisePoint origin, PreciseVector x, Real y_orientation, PreciseVector z);
  void set(PrecisePoint origin, PreciseVector x, PreciseVector y, Real z_orientation);

// After
  void set(
      PrecisePoint origin, Real x_orientation, PreciseVector y, PreciseVector z);
  void set(
      PrecisePoint origin, PreciseVector x, Real y_orientation, PreciseVector z);
  void set(PrecisePoint origin, PreciseVector x, PreciseVector y, Real z_orientation);

Probably it has to do with some heuristics related to the last comma. All lines are exactly the same length and the last one does not break. I use penalties… but I don’t see any penalty that would justify such a behaviour.

I can post my settings if anyone wants me to.

Endill March 10, 2024, 10:02pm 2

Can you file an issue for this on our bug tracker: Issues · llvm/llvm-project · GitHub?