Commit 06e2c330 authored by Nikolai Kosjar's avatar Nikolai Kosjar

C++: Fix "duplicate data type in declaration" for lambdas

The "_type" wasn't reset.

Task-number: QTCREATORBUG-12521
Change-Id: I0d38cb38e270260065313d1235d42f2689385850
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 80dd1dd2
......@@ -1108,7 +1108,7 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
type = this->specifier(it->value, type);
}
// unsigned mutable_token = ast->mutable_token;
type = this->exceptionSpecification(ast->exception_specification, type);
_type = this->exceptionSpecification(ast->exception_specification, type);
}
bool Bind::visit(TrailingReturnTypeAST *ast)
......
void f()
{
func([]() -> int { return 42; });
func([]() -> int { return 42; });
}
......@@ -157,6 +157,7 @@ void tst_cxx11::parse_data()
QTest::newRow("declType.1") << "declType.1.cpp" << "";
QTest::newRow("threadLocal.1") << "threadLocal.1.cpp" << "";
QTest::newRow("trailingtypespec.1") << "trailingtypespec.1.cpp" << "";
QTest::newRow("lambda.2") << "lambda.2.cpp" << "";
}
void tst_cxx11::parse()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment