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

    <tr>
        <th>Summary</th>
        <td>
            clang-format: incorrect indentation in initializer list
        </td>
    </tr>

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

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

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

<pre>
    ## Issue

In some cases, indentation in initializer list is incorrect across the same list

## Demonstration:

![image](https://github.com/llvm/llvm-project/assets/1759654/6266cb34-e959-44f3-82c6-fb86fc694578)
![image](https://github.com/llvm/llvm-project/assets/1759654/4e26bef1-5f9f-4116-b2f5-af2fa718e194)


## My config:

<details>
  <pre>
---
AccessModifierOffset: '-2'
AlignAfterOpenBracket: BlockIndent
AlignEscapedNewlines: Left
AllowAllArgumentsOnNextLine: 'false'
AllowAllConstructorInitializersOnNextLine: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'true'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: WebKit
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: 'false'
ColumnLimit: '120'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '2'
ContinuationIndentWidth: '2'
Cpp11BracedListStyle: 'false'
DerivePointerAlignment: 'false'
DisableFormat: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Preserve
IndentCaseLabels: 'true'
IndentPPDirectives: None
IndentWidth: '4'
IndentWrappedFunctionNames: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'false'
SpaceAfterCStyleCast: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
TabWidth: '4'
UseTab: Never

...

  </pre>
</details>

## Part of code that is incorrectly formatted:

```cpp
std::vector<StringEncodedMemoizedSensor<bool>*> buttons = std::vector<StringEncodedMemoizedSensor<bool>*>
{
#if BUTTON_A_ENABLED
    new BUTTON_CLASS(IEncodedInput::Type::A_BTN, PIN_BUTTON_A, BUTTON_A_INVERT),
#endif

#if BUTTON_B_ENABLED
 new BUTTON_CLASS(IEncodedInput::Type::B_BTN, PIN_BUTTON_B, BUTTON_B_INVERT),
#endif

#if BUTTON_JOYSTICK_ENABLED
      new BUTTON_CLASS(IEncodedInput::Type::JOY_BTN, PIN_BUTTON_JOYSTICK, BUTTON_JOYSTICK_INVERT),
#endif

#if BUTTON_MENU_ENABLED
 new BUTTON_CLASS(IEncodedInput::Type::MENU, PIN_BUTTON_MENU, BUTTON_MENU_INVERT),
#endif

#if GESTURE_TRIGGER_ENABLED && FINGER_INDEX_ENABLED
      new GESTURE_CLASS(
 IEncodedInput::Type::TRIGGER,
        new TriggerGesture(&handSensors.index.value(), GESTURE_TRIGGER_THRESHOLD)
 ),
#elif BUTTON_TRIGGER_ENABLED
    new BUTTON_CLASS(IEncodedInput::Type::TRIGGER, PIN_BUTTON_TRIGGER, BUTTON_TRIGGER_INVERT),
#endif

#if GESTURE_GRAB_ENABLED && FINGER_INDEX_ENABLED && FINGER_MIDDLE_ENABLED && FINGER_RING_ENABLED && FINGER_PINKY_ENABLED
      new GESTURE_CLASS(
 IEncodedInput::Type::GRAB,
        new GrabGesture(
 &handSensors.index.value(),
          &handSensors.middle.value(),
 &handSensors.ring.value(),
          &handSensors.pinky.value(),
 GESTURE_GRAB_THRESHOLD
        )
      ),
#elif BUTTON_GRAB_ENABLED
      new BUTTON_CLASS(IEncodedInput::Type::GRAB, PIN_BUTTON_GRAB, BUTTON_GRAB_INVERT),
#endif

#if GESTURE_PINCH_ENABLED && FINGER_THUMB_ENABLED && FINGER_INDEX_ENABLED
 new GESTURE_CLASS(
        IEncodedInput::Type::PINCH,
        new PinchGesture(&handSensors.thumb.value(), &handSensors.index.value(), GESTURE_PINCH_THRESHOLD)
      ),
#elif BUTTON_PINCH_ENABLED
 new BUTTON_CLASS(IEncodedInput::Type::PINCH, PIN_BUTTON_PINCH, BUTTON_PINCH_INVERT),
#endif
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0WF2TorwS_jV4Q2lpUNQLL8CPWd5x1FLn7NmrqQiN5kxIOEmYWd9ffyoggojOx553y3LH5OnuJ92dJwEsJdkzgJHRc43epIETdeBiRIGztjUcNnY8OI4MZBnIMj0pEzDaE6PtZN8eMyWPwPSxBGmgsUlYAExhRTgzif4QRTAlf4MwKZHKJNIkzOdCgK9M7AsupakOYEocQYooez9FnUDEmVQi9WpYziWkY_RcEuE9GL2JgQYHpWKpQWhmoNmeqEOya_k8MtCM0rf8v2Ys-H_AVwaaYSlBSQPNOv3e0O51DTSzkW37O6vbhGFv2Ox2Q6s5QL7dDHcDO_TtYbfXHxho-A8y6A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