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

Broken identation on tuple structured binding

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.14.0
    • C/C++/Obj-C++ Support
    • None
    • Windows 10. Qt Creator 4.14.0
    • All

      Minimum code to reproduce bug:

      #include <tuple>
      
      std::tuple<int, bool> getIntBool()
      {
          return std::make_tuple(100, true);
      }
      
      int main(int argc, char *argv[])
      {
          auto [myint, mybool] = getIntBool();
                  int broken_indentation = myint; //Extra indentation
                  bool it_continues = mybool;
      
                  return 0;
      }
      

      After string "auto [myint, mybool] = getIntBool();" Qt Creator indents all following lines wrongly with 8 extra spaces.

      What expected is no extra indentation and code should look like this:

      #include <tuple>
      
      std::tuple<int, bool> getIntBool()
      {
          return std::make_tuple(100, true);
      }
      
      int main(int argc, char *argv[])
      {
          auto [myint, mybool] = getIntBool();
          int broken_indentation = myint;
          bool it_continues = mybool;
      
          return 0;
      }
      

       

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

            kandeler Christian Kandeler
            asc7uni Mikhail
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes