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

Incorrect indent for lambdas with explicit return type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • Qt Creator 2.8.0, Qt Creator 3.0.0-rc1
    • C/C++/Obj-C++ Support
    • None
    • 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

              kandeler Christian Kandeler
              stefan dessens Stefan Dessens
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes