Before:
if () {
}
else {
}
After:
if () {
} else {
}
This fixed llvm.org/PR17262.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190855
91177308-0d34-0410-b5e6-
96231b3b80d8
Style.BreakConstructorInitializersBeforeComma) {
Current->MustBreakBefore = true;
} else if (Current->Previous->BlockKind == BK_Block &&
+ Current->Previous->isNot(tok::r_brace) &&
Current->isNot(tok::r_brace)) {
Current->MustBreakBefore = true;
} else if (Current->is(tok::l_brace) && (Current->BlockKind == BK_Block)) {
"else {\n"
" i();\n"
"}");
+ verifyFormat("void f() {\n"
+ " if (a) {\n"
+ " } else {\n"
+ " }\n"
+ "}");
}
TEST_F(FormatTest, ElseIf) {