Closed
Description
Bugzilla Link | 47936 |
Version | 11.0 |
OS | Linux |
CC | @KitsuneRal,@elvenfighter,@mydeveloperday |
Extended Description
Using the MultiLine setting for BraceWrapping.AfterControlStatement appears to disable AllowShortFunctionsOnASingleLine, even in cases without any control statements. For the input:
void bar() {}
class Foo {
void shortfunction() { bar(); }
};
The command:
clang-format --style="{BasedOnStyle: llvm, AllowShortFunctionsOnASingleLine: Inline, BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true, AfterControlStatement: MultiLine}}"
produces:
void bar() {}
class Foo {
void shortfunction()
{
bar();
}
};
If MultiLine is replaced with Always or Never, or is left out entirely, we get:
void bar() {}
class Foo {
void shortfunction() { bar(); }
};
which is the expected result, as no control statements are present.