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

"Convert to Pointer" generates invalid code when used on auto variable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 3.3.1
    • Qt Creator 3.3.0
    • C/C++/Obj-C++ Support
    • None
    • Windows 7 64 bit
    • c64a3891a20719c66c671ecfea6081d013fcab8b

    Description

      1. Open a C++-file with the following lines:
        auto s = new QString;
        s->length();
        

        Note that s is of type QString*.

      2. Right-click on the declaration of s and select "Refactor" -> "Convert to Pointer" from the context menu.
        The code will be changed to:
        auto *s = new QString;
        s->>length();
        

        This is invalid code.

      The code should remain valid. It could be change to this instead:

      auto *s = new QString;
      s->length();
      

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              rlohning Robert Löhning
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes