| Issue |
58121
|
| Summary |
[clang-format] `AllowShortBlocksOnASingleLine` is not working as documented
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Mode-77
|
**Problem**
`Always` option does not work as documented.
**Version**
`>clang-format --version`
`clang-format version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9)`
**How to replicate**
The example input text is straight from the documentation example for `AllowShortBlocksOnASingleLine`.
*In:*
```c
while (true) {
}
while (true) {
continue;
}
```
*Expected:*
```c
while (true) {}
while (true) { continue; }
```
`clang-format -style="{Language: Cpp, AllowShortBlocksOnASingleLine: Always}" example.c`
*Actual:*
```c
while (true) {}
while (true) {
continue;
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs