Before:
int i = (*b)[a] -> f();
After:
int i = (*b)[a]->f();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203557
91177308-0d34-0410-b5e6-
96231b3b80d8
// FIXME: This is a dirty way to access the previous token. Find a better
// solution.
if (!Line->Tokens.empty() &&
- (Line->Tokens.back().Tok->isOneOf(tok::identifier, tok::kw_operator,
- tok::r_square) ||
+ (Line->Tokens.back().Tok->isOneOf(tok::identifier, tok::kw_operator) ||
+ Line->Tokens.back().Tok->closesScope() ||
Line->Tokens.back().Tok->isSimpleTypeSpecifier())) {
nextToken();
return false;
"int i;");
verifyFormat("std::unique_ptr<int[]> foo() {}");
verifyFormat("int i = a[a][a]->f();");
+ verifyFormat("int i = (*b)[a]->f();");
// Other corner cases.
verifyFormat("void f() {\n"