From 5be4214b289196ad7531958e6685b8c342ee0915 Mon Sep 17 00:00:00 2001 From: Flex Ferrum Date: Mon, 19 Mar 2012 23:48:39 +0400 Subject: [PATCH] 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 --- src/libs/3rdparty/cplusplus/Bind.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp index 4ed0fdd099c..0d006911e4b 100644 --- a/src/libs/3rdparty/cplusplus/Bind.cpp +++ b/src/libs/3rdparty/cplusplus/Bind.cpp @@ -1099,7 +1099,12 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast) 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; FullySpecifiedType type; @@ -1110,7 +1115,6 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast) } // unsigned mutable_token = ast->mutable_token; type = this->exceptionSpecification(ast->exception_specification, type); - type = this->trailingReturnType(ast->trailing_return_type, type); } bool Bind::visit(TrailingReturnTypeAST *ast)