containerList; auto wasAlre...">

What does "duplicate data type in declaration" mean?

Please take a look at this piece of code:

QList< cContainers * > containerList; auto wasAlreadyMoved = [&containerList]( cItem * item ) -> bool { //<--------- for( cContainer * tmp : containerList ) if( tmp->contains( item ) ) return true; return false; }; 

I am using Qt Creator 2.8.0, with Qt 5.1.0 under Ubuntu 13.04. I also use Clang 3.2.1 as a compiler.

The above code compiles fine (no errors, no warnings), but QtCreator underlines the highlighted line of code with a red line (as with errors):

enter image description here

If I hover over it, it says β€œduplicate the data type in the declaration,” and I have no idea what that means. This is the simplest lambda, and I don't see any problems with it, so why is this happening? Is this a QtCreator syntax highlighting error?

+4
source share
1 answer

I think this error has already appeared in QtCreator bugtracker: Lambda return type "void" is perceived as "duplicate data type in declaration".

[error # 8773] ( https://bugreports.qt.io/browse/QTCREATORBUG-8773 )

+7
source

Source: https://habr.com/ru/post/1502409/


All Articles