Before:
for (int i = 0; i* 2 < z; i *= 2) {}
After:
for (int i = 0; i * 2 < z; i *= 2) {}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190546
91177308-0d34-0410-b5e6-
96231b3b80d8
(!Current.Previous || Current.Previous->isNot(tok::kw_operator))) {
Contexts.back().IsExpression = true;
for (FormatToken *Previous = Current.Previous;
- Previous && Previous->isNot(tok::comma);
+ Previous && !Previous->isOneOf(tok::comma, tok::semi);
Previous = Previous->Previous) {
if (Previous->is(tok::r_square))
Previous = Previous->MatchingParen;
"}");
verifyFormat("for (int i = a * a; i < 10; ++i) {\n}");
verifyFormat("for (int i = 0; i < a * a; ++i) {\n}");
+ verifyGoogleFormat("for (int i = 0; i * 2 < z; i *= 2) {\n}");
verifyFormat("#define MACRO \\\n"
" int *i = a * b; \\\n"