Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
Qt Creator 2.8.1, Qt Creator 3.0.0-rc1
-
None
Description
The following will compile and run, but shows error red line in Qt Creator.
One other detail: If I changed the int after -> to other types. It shows no error.
#include <QCoreApplication> #include <QString> #include <QList> #include <functional> #include <QDebug> auto a = [](const QString &data) -> int { return data.toInt() + 1; }; auto b = [](const QString &data) -> int { return data.toInt() + 1; }; int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); qDebug() << b("123"); qDebug() << a("123"); }
Attachments
Issue Links
- is replaced by
-
QTCREATORBUG-12521 lambda that returns primitive type fails on parsing
- Closed