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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 08:18:18 PDT 2022


MyDeveloperDay added a comment.

Going back to the original bug that caused this.. if you leave in your BOS_NonAssignment I think you'll reintroduce the original bug..  which possibly should have been called

"incorrectly adds extra continuation indent spaces with BreakBeforeBinaryOperators set to All *(and NonAssignement)*"

i.e.

  bool BreakBeforeBinaryOperators(
          bool someVeryVeryLongConditionThatBarelyFitsOnALine,
          bool someOtherLongishConditionPart1,
          bool someOtherEvenLongerNestedConditionPart2) {
          return someVeryVeryLongConditionThatBarelyFitsOnALine
                  && (someOtherLongishConditionPart1
                          || someOtherEvenLongerNestedConditionPart2);
  }

will bcome

  bool BreakBeforeBinaryOperators(
          bool someVeryVeryLongConditionThatBarelyFitsOnALine,
          bool someOtherLongishConditionPart1,
          bool someOtherEvenLongerNestedConditionPart2) {
          return someVeryVeryLongConditionThatBarelyFitsOnALine
                  && (someOtherLongishConditionPart1
                             || someOtherEvenLongerNestedConditionPart2);
                       ^^^^^^^^
  }

                     


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

https://reviews.llvm.org/D136154



More information about the cfe-commits mailing list