Before:
if (a) {
f();
}
// or else ..
else {
g();
}
After:
if (a) {
f();
}
// or else ..
else {
g();
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193684
91177308-0d34-0410-b5e6-
96231b3b80d8
State.Column = State.Stack.back().Indent;
// Ensure that we fall back to the continuation indent width instead of just
// flushing continuations left.
- if (State.Column == State.FirstIndent)
+ if (State.Column == State.FirstIndent &&
+ PreviousNonComment->isNot(tok::r_brace))
State.Column += Style.ContinuationIndentWidth;
}
" g();\n"
"else\n"
" h();");
+ verifyFormat("if (a) {\n"
+ " f();\n"
+ "}\n"
+ "// or else ..\n"
+ "else {\n"
+ " g()\n"
+ "}");
}
TEST_F(FormatTest, FormatsForLoop) {