[clang-format] AllowShortBlocksOnASingleLine=Always overrides brace wrapping for functions
Open
clang-format
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
In version 22 `AllowShortBlocksOnASingleLine=Always` overrides
```yaml
BraceWrapping:
AfterFunction: true
```
and results in function bodies being compactified:
```c++
void f()
{return ;}
```
Contributor guide
Research direction
Start by reproducing the reported C++ formatting with AllowShortBlocksOnASingleLine=Always and BraceWrapping.AfterFunction=true, then trace the clang-format handling for these two options. Done means the configuration no longer compactifies the function body and preserves the requested brace wrapping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100