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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] AlignOperands: DontAlign doesn't seem to affect ternary operators
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

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

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

<pre>
    I'm using `clang-format` 19.1.0 and the following config file to format the following C++ code.

```yaml
AlignOperands: DontAlign
BreakBeforeBinaryOperators: NonAssignment
ColumnLimit: 80
```

```cpp
void test() {
  const auto c = "dddddddddddddddddd"
 ? "ffffffffffffffffffffffffffffffffff"
    : "ddddddddddddddddddddddddddd";
}
```

**Expected result:**

The file remains formatted as-is. The [documentation for AlignOperands](https://releases.llvm.org/19.1.0/tools/clang/docs/ClangFormatStyleOptions.html#alignoperands) says:

> `DontAlign`: Do not align operands of binary and ternary expressions. The wrapped lines are indented `ContinuationIndentWidth` spaces from the start of the line.

**Actual result:**

The `:` of the ternary operator gets aligned with the `?`, like this:

```cpp
void test() {
 const auto c = "dddddddddddddddddd" ? "ffffffffffffffffffffffffffffffffff"
 : "ddddddddddddddddddddddddddd";
}
```


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVF2vmzgQ_TXDy-giYwIJDzyQpEiVVtuHrtRnBw_BW2Mj29zb_PuVTe72ph_aroqsBJszH8dzZoT36mqIWqiOUJ0zsYbJuvYsjCL98ZPVY3ax8ta-B76fcfXKXBFqNmhhrk-jdbMIUDMsmrzIGQojMUyEo9XavkTsYM2orjgqTRgsbhbfYE7Aj8CPOFhJObAurppt6yZmDazrtLqaDws5YaSHssOzNSEdAuuOjsTnI43W0VEZ4W4JGKxLyD-t6RLJmUwA1p2sXmfzh5pViJ8P7G24b6IPywKse7ZKYiAfgB-ANwj7I7AOIzcfUKzB4oBQnhE4l989wHlEQ9nH7-N_Pnc8Isb0fujywXcZk4H9-Qc0eFzvviw0BJLoyK86ct7ON8xfsRKxOI5moYy_VyjihX9SPseIgOoo7bDGGxRBWRNR-FiT6gz8MIWw-BShB9470iQ8-Vzr5zm37gq834QCvA_Wag-8T0oC3ks7xO0pbvuUw8dw0_RhifF8PoVZAy9FjGlfY_IGvbilgBvh8l0U51dt1GzTChobMNniqzHaES9JLZtqyaV3-rI48j7FTNRfnFgWkqiVIY_CESojycQLgpqdrAnKrOlS3qfzT0qGKbaEX8RAHkdn56R3H4QLMWrcRG_52yp1Q1iF_nmNNirR793Da8L2rnW8UvAbR5L4osKUYMmuj7_8hFp9JgyTenNjv6T0Xxb6_1b570o8k20pm7IRGbXFvix3B1bW-2xqm6aqimq81OLCG852Iy-aSymbel_uR1lWmWo547uCs7pgRcP3uTg0xYFKtuO7YSjrCnYstoT-V72Z8n6ltigOTcUyLS6kfRqbnD-MQ87jIHVttHu6rFcPO6aVD1_7IAsq6DRyHwyrM_58zqG05A3wfUBPNMdhKsaRhvCdEny2Ot0-tuJVhWm95IOdgfcxjfvf0-Ls3zQE4H1iF1vwTvC55f8EAAD__7wG8JI">