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nVB87KRXD7jbc039YbOaEDd2vYXap9_g45qmAWr2o998nApnQvg8KWpy8VmNrTrerMUrGmKDj9zm4KJuitoWYhlScWGCT5TtMMStVmDM63ScCApBL5nzd3s-xHItiqqqijLqlgXTbPIV-WyE3W9WlBar-lqnS0KHAlS5TFObmw_s20K2YXeoVFhbd2rkWL79RogAUaEXnqVFlefveaOfIPECTfgNI4WfxS4i-5TGXGsXVYKR9NknSV-bSL3N9CZ2Kg>53149</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] AllowShortIfStatementsOnASingleLine doesn't treat short braced-substatements as short
        </td>
    </tr>

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

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

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

<pre>
    ```
> clang-format --version
clang-format version 13.0.1 (https://github.com/llvm/llvm-project.git 9dc7d6d5e3261f2cb1ae746ddaaf2f4d4f1f5350)
```

Consider:

```c++
if (true)
  break;

if (true)
{
  break;
}
```

Given the `.clang-format` configuration:

```
---
Language: Cpp
AllowShortIfStatementsOnASingleLine: WithoutElse
...
```

Actual:

```c++
if (true) break;

if (true) {
  break;
}
```

Expected:

```c++
if (true) break;

if (true) { break; }
```

As such, when the substatement in a _selection-statement_ is a single statement, clang-format produces a different output than when the substatement is a _compound-statement_ that contains a single statement. Semantically, the first is as-if the second and so it's confusing to treat them differently without an explicit option.

Additionally, the current behaviour appears to be a regression since when `AllowShortIfStatementsOnASingleLine` was previously a boolean set to `true`, then the above example would produce the expected result.

Instead, I think `AllowShortIfStatementsOnASingleLine` ought to treat these two cases identically for both `if` and `else` forms of the `if` statement for all supported options. This change would improve the consistency with other `AllowShortXOnASingleLine` options and make these options universally useful for coding standards that require braces around all control statement substatements.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1Vdtu4zYQ_Rr5hbAgUZIvD35wLi0CbFF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