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

Incorrect indentation after C++17 structured binding declaration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 7.0.0
    • Qt Creator 4.6.0-beta1, Qt Creator 4.7.0-beta1, Qt Creator 7.0.0
    • C/C++/Obj-C++ Support
    • None

    Description

      When typing a C++17 structured binding declaration and pressing enter, QtCreator increases the indentation of the next line by two units.

      For example, try typing the following code:

      std::map< int, int > m;
      auto [it, new_element] = m.insert(std::make_pair(1, 10));
      

      After I press Enter at the end of the second line, the next line gets indented two tabs deeper. QtCreator keeps adding the two tabs even after some properly indented code after the structured binding.

      Attachments

        1. clangformatactivated.png
          clangformatactivated.png
          42 kB
        2. qtcreatorwrongident.png
          qtcreatorwrongident.png
          14 kB
        3. qtversion.png
          qtversion.png
          25 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            lastique Andrey Semashev
            Votes:
            5 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes