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

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

XMLWordPrintable

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

      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();
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes