Before:
return (a > b
// comment1
// comment2
|| c);
After:
return (a > b
// comment1
// comment2
|| c);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223234
91177308-0d34-0410-b5e6-
96231b3b80d8
Start->StartsBinaryExpression = true;
if (Current) {
FormatToken *Previous = Current->Previous;
- if (Previous->is(tok::comment) && Previous->Previous)
+ while (Previous->is(tok::comment) && Previous->Previous)
Previous = Previous->Previous;
++Previous->FakeRParens;
if (Precedence > prec::Unknown)
" + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n"
" * cccccccccccccccccccccccccccccccccccc;",
Style);
+
+ Style.AlignAfterOpenBracket = false;
+ verifyFormat("return (a > b\n"
+ " // comment1\n"
+ " // comment2\n"
+ " || c);",
+ Style);
}
TEST_F(FormatTest, BreakingBeforeNonAssigmentOperators) {