[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 26 06:20:44 PDT 2017


djasper added a comment.

In https://reviews.llvm.org/D32478#765583, @Typz wrote:

> I actually don't know how, but it still manages somehow : I rebuilt this exact patch to ensure I gave you the correct output.
>  And the same behavior can be seen in the test cases, where the operator with highest precedence is aligned with the equal sign.


So, it's formatting like this?

  bool a = aaaaaa   //
            == bbbb //
        && ccccc;
  
  auto a = aaaaaa    //
             == bbbb //
         + ccccc;

While that's interesting and I'd like to figure out how it actually works, I also think it's really weird to indent the inner "==" differently based on the kind of operator around it. The existing way to format these operators is nice and consistent here with always adding a multiple of four spaces.


https://reviews.llvm.org/D32478





More information about the cfe-commits mailing list