[PATCH] D119599: [clang-format] Add option to align compound assignments like `+=`

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 6 05:57:56 PST 2022


HazardyKnusperkeks added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:16800
+                   Alignment));
+}
+
----------------
sstwcw wrote:
> HazardyKnusperkeks wrote:
> > Can you test it with `AlignConsecutiveDeclarations`?
> Do you mean like the formatting the same code with `AlignConsecutiveAssignments.Enabled` being false and `AlignConsecutiveDeclarations.Enabled` being true?  By the way, I just realized that things like `int a += 5;` are not valid code.  Should I remove the `int ` instead?
No I meant both enabled, with the `AlignCompound` one time with and without `PadOperators`. To see if the options work nicely together.

But yeah, as you stated this isn't valid code, so it doen't really matter how it is formatted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119599/new/

https://reviews.llvm.org/D119599



More information about the cfe-commits mailing list