-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Description
| Bugzilla Link | 25069 |
| Version | unspecified |
| OS | Linux |
| CC | @Bagira80 |
Extended Description
Consider the following code:
void foo()
{
while(true)
{
bar();
}
}
When calling
clang-format ./c.cpp -style="{BreakBeforeBraces: Allman}"
or
clang-format ./c.cpp -style="{BreakBeforeBraces: Allman, AllowShortLoopsOnASingleLine: true}"
the result is:
void foo()
{
while(true)
{
bar();
}
}
This is the intended result.
When calling
clang-format ./cf.cpp -style="{BreakBeforeBraces: Allman, AllowShortLoopsOnASingleLine: true, AllowShortBlocksOnASingleLine: true}"
the result is:
void foo()
{
while(true) {
bar();
}
}
For some reason, the combination of
BreakBeforeBraces: Allman
AllowShortLoopsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
makes the braces for loops (and control statements, if the other AllowShort... flags are activated) be indented incorrectly.
Seems like a bug.
More information:
http://stackoverflow.com/questions/32907190/