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

Fixits produce garbled code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • Qt Creator 4.14.0, Qt Creator 6.0.0-beta2
    • None
    • Ubuntu 20.04 LTS
    • Linux/X11

    Description

      Applying the fix its suggested by clang tidy -wreadability-convert-member-functions-to-static produces garbled code for const member funcs with multiline declarations.

      class Foo
      {
      public:
          void test1(int a,
                     int b,
                     int c) const;
          void test2(int a,
                     int b,
                     int c) const;
      };
      
      void Foo::test1(int a, int b, int c) const
      {
          qDebug() << a << b << c;
      }
      
      void Foo::test2(int a, int b, int c) const
      {
          qDebug() << a << b << c;
      }
      

      becomes

      class Foo
      {
      public:
          static void test1(int a, int b, int c) const;
          static void test2(int a, int b, int c);
      };
      
      void Foo::test1(int a, int b, int c) const
      {
          qDebug() << a << c;
      }
      
      void Foo::test2(int a, int b, int c) c{
          qDebug() << a << b << c;
      }
      

      Note const is not removed, occasionally trailing blanks are left in the source and declarations can be quite badly broken. https://codereview.qt-project.org/c/pyside/pyside-setup/+/331199 required many manual corrections.

      Attachments

        1. qtcreatorbug25269.jpg
          172 kB
          Friedemann Kleint
        2. qtcreatorbug25269.zip
          0.8 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              kandeler Christian Kandeler
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes