Before:
void f() { f(new a(), c *d); }
After:
void f() { f(new a(), c * d); }
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237249
91177308-0d34-0410-b5e6-
96231b3b80d8
MightBeObjCForRangeLoop = false;
if (MightBeObjCForRangeLoop && CurrentToken->is(Keywords.kw_in))
CurrentToken->Type = TT_ObjCForIn;
+ // When we discover a 'new', we set CanBeExpression to 'false' in order to
+ // parse the type correctly. Reset that after a comma.
+ if (CurrentToken->is(tok::comma))
+ Contexts.back().CanBeExpression = true;
FormatToken *Tok = CurrentToken;
if (!consumeToken())
verifyFormat("Constructor() : a(a), area(a, width * height) {}");
verifyGoogleFormat("MACRO Constructor(const int& i) : a(a), b(b) {}");
verifyFormat("void f() { f(a, c * d); }");
+ verifyFormat("void f() { f(new a(), c * d); }");
verifyIndependentOfContext("InvalidRegions[*R] = 0;");