forked from OSchip/llvm-project
clang-format: Fix another false positive in the lambda detection.
Before: int i = (*b)[a] -> f(); After: int i = (*b)[a]->f(); llvm-svn: 203557
This commit is contained in:
parent
d3c7ab975f
commit
a58dd5db29
|
@ -758,8 +758,8 @@ bool UnwrappedLineParser::tryToParseLambda() {
|
|||
// 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;
|
||||
|
|
|
@ -7981,6 +7981,7 @@ TEST_F(FormatTest, FormatsLambdas) {
|
|||
"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"
|
||||
|
|
Loading…
Reference in New Issue