C++: Fix lambda declarator processing

Now Qt Creator does not warn about lambda declaration with not empty
parameters list.

Task-number: QTCREATORBUG-6243
Change-Id: I07121a80fbca98c36820d1d8bb1be6e82ab96b12
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
This commit is contained in:
Flex Ferrum
2012-03-19 23:48:39 +04:00
committed by Erik Verbruggen
parent 68c843fc35
commit 5be4214b28

View File

@@ -1099,7 +1099,12 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
return; return;
Function *fun = 0; // ### implement me Function *fun = control()->newFunction(0, 0);
fun->setStartOffset(tokenAt(ast->firstToken()).begin());
fun->setEndOffset(tokenAt(ast->lastToken() - 1).end());
if (ast->trailing_return_type)
_type = this->trailingReturnType(ast->trailing_return_type, _type);
fun->setReturnType(_type);
// unsigned lparen_token = ast->lparen_token; // unsigned lparen_token = ast->lparen_token;
FullySpecifiedType type; FullySpecifiedType type;
@@ -1110,7 +1115,6 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
} }
// unsigned mutable_token = ast->mutable_token; // unsigned mutable_token = ast->mutable_token;
type = this->exceptionSpecification(ast->exception_specification, type); type = this->exceptionSpecification(ast->exception_specification, type);
type = this->trailingReturnType(ast->trailing_return_type, type);
} }
bool Bind::visit(TrailingReturnTypeAST *ast) bool Bind::visit(TrailingReturnTypeAST *ast)