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

Bad indentation after structured binding

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.13.0-rc1
    • Editors
    • None
    • macOS

      Consider the code below.

      If pressing enter at the end of the line with 'auto', the indentation suddenly jumps to 12 characters (instead of the expected 4).

      It does not only mess up the indentation at that single location, but at all points beyond it in the file. This makes Creator quite unusable with any source file that makes use of structured bindings.

      This happens in 4.12.3, as well as 4.13 RC1.

      #include <utility>
      
      std::pair<int,int> f() {
          return {1,2};
      }
      
      void g() {
          auto [x,y] = f();
      }
      

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

            davschul David Schulz
            szhorvat Szabolcs Horvát
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes