Logo Questions Linux Laravel Mysql Ubuntu Git Menu

What does "duplicate data type in declaration" mean?

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):

enter image description here

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?

like image 642
SingerOfTheFall Avatar asked Mar 23 '23 09:03


1 Answers

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)

like image 50
Mali Avatar answered Mar 24 '23 22:03