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

Qt Creator says "undefined function" for lambda functions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • Qt Creator 2.5.0-rc
    • Qt Creator 2.1.0, Qt Creator 2.2.0-beta
    • None
    • Any OS with a compiler that supports Lambda functions
    • 5be4214b289196ad7531958e6685b8c342ee0915

    Description

      When I enter a lambda expression to Qt Creator, it will underline the whole line with green and this underline displays a tooltip that says "undefined function".
      This happens both when I assign a lambda function to a function pointer, and also when I pass a lambda function as a parameter.

      Example code snippet:

      bool (*is_this_the_answer)(int) = [](int x)

      { return x == 42; }

      ;
      int i;
      std::cin >> i;
      std::cout << (is_this_the_answer ? "yep!" : "nope!") << std::endl;

      Note that Qt Creator also messes up the auto-indentation after it encounters a line with a lambda expression.

      Attachments

        Issue Links

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

          Activity

            People

              erikv Erik Verbruggen
              venemo Timur Kristóf
              Votes:
              7 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes