Please take a look at this code snippet:
QList< cContainers * > containerList;
auto wasAlreadyMoved = [&containerList]( cItem * item ) -> bool { //<---------
for( cContainer * tmp : containerList )
if( tmp->contains( item ) )
return true;
return false;
};
I'm using Qt Creator 2.8.0, with Qt 5.1.0 under Ubuntu 13.04. I'm also using Clang 3.2.1 as a compiler.
The above code compiles fine (no errors, no warnings), but QtCreator underlines the marked line of code with a red line (as it does with errors):
If I hover my mouse over it, it says "duplicate data type in declaration", and I have no idea what does it mean. It is the most simple lambda, and I fail to see any problems with it, so why does it happen? Is it a QtCreator syntax highlighting bug?
I think it is this bug already reported in QtCreator bugtracker: Lambda's return type "void" is perceived as "duplicate data type in declaration".
[bug #8773] (https://bugreports.qt.io/browse/QTCREATORBUG-8773)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With