<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54663>54663</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] 'else if' clause not broken when using AlignAfterOpenBracket: BlockIndent
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          yseymour
      </td>
    </tr>
</table>

<pre>
    **clang-format version:**
`Debian clang-format version 14.0.0-++20220329040358+3f43d803382d-1~exp1~20220329160446.105`

**Code:**
```c++
void foo() {
        if (thisIsRatherALongIfClause && thatIExpectToBeBroken || ontoMultipleLines && whenFormattedCorrectly) {
        }

        if (false) {
        }
        else if (thisIsRatherALongIfClause && thatIExpectToBeBroken || ontoMultipleLines && whenFormattedCorrectly) {
        }
}
```

**Output** with defaults:
```
❯ clang-format --style='{ColumnLimit: 60}' tmp.cc
void foo() {
  if (thisIsRatherALongIfClause && thatIExpectToBeBroken ||
      ontoMultipleLines && whenFormattedCorrectly) {
  }

  if (false) {
  } else if (thisIsRatherALongIfClause &&
                 thatIExpectToBeBroken ||
             ontoMultipleLines && whenFormattedCorrectly) {
  }
}
```

**Output** with `AlignAfterOpenBracket: BlockIndent`
```
❯ clang-format --style='{ColumnLimit: 60, AlignAfterOpenBracket: BlockIndent}' tmp.cc
void foo() {
  if (thisIsRatherALongIfClause && thatIExpectToBeBroken ||
      ontoMultipleLines && whenFormattedCorrectly) {
  }

  if (false) {
  } else if (thisIsRatherALongIfClause && thatIExpectToBeBroken || ontoMultipleLines && whenFormattedCorrectly) {
  }
}
```

**Expected output:**  
First of all, I was intuitively expecting `BlockIndent` to break the if/else-if clause in a similar way to a function declaration:
```c++
void foo(
    int veryLongArgumentName1, int veryLongArgumentName2,
    int veryLongArgumentName3
) {}
```
and my hope was that there would be a `BinPack...` option to place each part of the clause on each line just as one can with arguments and parameters, but that doesn't seem to be the case.

If that's not possible and/or it's not a design goal for that option, then at the least I'd expect the `else if` clause to be broken, because currently it doesn't get wrapped at all when the `BlockIndent` alignment style is used, which seems buggy.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztVttu4zYQ_Rr5ZWBBN1v2gx98iQEDabco-gOUNJK4oUiBpOLV33dI2YmzSbrZNij6UIOwJA45c-bMGUqFqsZNkGxplILJZl4r3TELj6gNVzJIt5MxiA5BtA2W0QELziS8tRjiLIzCaB4kOxpJlCRRmqyjLEoXK5pI6yytVlGarpJqHgf5HX7r3eW6MF5GWbYM42hBYS7xpn-PYK8qfA1nGuUUcpp9VLyCWqkgoahrCPLLPFx-vAYy2Zabk_md2Rb19l7J5lTvBRsMknFJA2zL7OnuW4-l_UPtcKfVA0rytqcBSlr1yyAs7wXec4nmuuvcojx6VixWe6U1bRfjmziC_HCb5Ut4NRMG_3rbdQJp5X8wqaeba5Fel_TLYPvBTvdw5raFCmtGCIwr9Ju775JgfQi2x5cCnM-NHQXJ4xAkOWHaKzF08p533JInoN25s4Dt-rAsfySTT-DylpR_RusrlbyvD1r6M2J4Wbin30fTgs_N7m_JhZZtBW_ktraov_Qod5qVD-iLvhOqfDjJCqV99vZJakr28KG4_6vuXz2CfkpNEwSsQE2yur5ayI1fdeTaWFA1MCFcwU9wZga4tAO3_BHFCOg9cNk4Hb6UG1gFhUb2QOk6ZoLk6DiaE0flxAaXwMCQpgTT5Hl0OxjUgySP9CqtkNZpZi_v4A--7p7qTzDdW3l0BdjqZugI1q-sw9hl8p4xIeOPXaRXEifq32GayQq6EVrVo-fNVd1xoelRDaKCAildxxuXv1HvhGHoaFO9z5646AUrEZCVLfRM-0I4Ki_s0RpvEqQR-DpQoSiGovuSvk380cAukA04KOSCoFOzGkdAMdgJUKXQSGpRCwax80XDKQwzGN5q5lT7HbTWgFQWemUMLwQ671RcpYE_GxmVz9DxAI1igmqjp2hTcg4AhaDye0JAICP4J9pcXRTlp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