forked from qt-creator/qt-creator
C++: Fix completion for lambda parameters
Change-Id: I6db51aeba328dbb69ec59082a70be7bc2d95699b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
17
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
17
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -1087,11 +1087,10 @@ bool Bind::visit(LambdaDeclaratorAST *ast)
|
||||
return false;
|
||||
}
|
||||
|
||||
void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
|
||||
Function *Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
|
||||
{
|
||||
if (! ast)
|
||||
return;
|
||||
|
||||
return 0;
|
||||
|
||||
Function *fun = control()->newFunction(0, 0);
|
||||
fun->setStartOffset(tokenAt(ast->firstToken()).utf16charsBegin());
|
||||
@@ -1109,6 +1108,7 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
|
||||
}
|
||||
// unsigned mutable_token = ast->mutable_token;
|
||||
_type = this->exceptionSpecification(ast->exception_specification, type);
|
||||
return fun;
|
||||
}
|
||||
|
||||
bool Bind::visit(TrailingReturnTypeAST *ast)
|
||||
@@ -1780,8 +1780,15 @@ bool Bind::visit(ObjCSelectorExpressionAST *ast)
|
||||
bool Bind::visit(LambdaExpressionAST *ast)
|
||||
{
|
||||
this->lambdaIntroducer(ast->lambda_introducer);
|
||||
this->lambdaDeclarator(ast->lambda_declarator);
|
||||
this->statement(ast->statement);
|
||||
if (Function *function = this->lambdaDeclarator(ast->lambda_declarator)) {
|
||||
_scope->addMember(function);
|
||||
Scope *previousScope = switchScope(function);
|
||||
this->statement(ast->statement);
|
||||
(void) switchScope(previousScope);
|
||||
} else {
|
||||
this->statement(ast->statement);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user