Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-10537

declare int as lambda result type will generate error red line

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • Qt Creator 2.8.1, Qt Creator 3.0.0-rc1
    • C/C++/Obj-C++ Support
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kosjar Nikolai Kosjar
              kimi arthur Kimi Arthur
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes