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

Broken identation on tuple structured binding

    XMLWordPrintable

Details

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

    Description

      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;
      }
      

       

      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
              asc7uni Mikhail
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes