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

Incorrect indent for lambdas with explicit return type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 2.8.0, Qt Creator 3.0.0-rc1
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      Windows 8 x64

      Description

      The folowing line:

      auto foo = [&]() -> int { return bar[1]; };
      

      Causes the auto-identer to fail for all lines after this lambda statement. This problem exists for all lambdas with both an explicitly specified return type and the usage of operator[] as the final statement in the lambda.

      additionally, a lambda such as:

          auto foo = [&]() -> int
          { 
                  return 1;
      };

      Will incorrectly align both the content of the lambda and the ending };. Everything else will be fine. The omission of the return specifier will prevent this erroneous behavior.

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                kosjar Nikolai Kosjar
                Reporter:
                stefan dessens Stefan Dessens
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes