[PATCH] D136154: [clang-format] Fix the continuation indenter

Henrik Lafrenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 05:45:58 PDT 2022


hel-ableton marked an inline comment as done.
hel-ableton added a comment.

In D136154#3867968 <https://reviews.llvm.org/D136154#3867968>, @MyDeveloperDay wrote:

> Doesn't something like this  achieve the same
>
>        CurrentState.Indent = State.Column;
>        CurrentState.LastSpace = State.Column;
>   -  } else if ((Previous.isOneOf(TT_BinaryOperator, TT_ConditionalExpr,
>   -                               TT_CtorInitializerColon)) &&
>   +  } else if (Previous.is(TT_CtorInitializerColon)) {
>   +    CurrentState.LastSpace = State.Column;
>   +  } else if ((Previous.isOneOf(TT_BinaryOperator, TT_ConditionalExpr)) &&
>                 ((Previous.getPrecedence() != prec::Assignment &&
>                   (Previous.isNot(tok::lessless) || Previous.OperatorIndex != 0 ||
>
> Regardless of the choice of BreakBeforeBinaryOperators?
>
> BTW I checked such a change passes all the other unit tests. (Beyonce rule!!)

If you think this would be the better fix, AFAICS it does what we need. What's the Beyonce rule, by the way?


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

https://reviews.llvm.org/D136154



More information about the cfe-commits mailing list