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

Follow under symbol does not jump to implementation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • Qt Creator 8.0.2, Qt Creator 9.0.2, Qt Creator 10.0.0
    • C/C++/Obj-C++ Support
    • None
    • Linux/X11, Windows

    Description

      I noticed that sometimes following a method does not work for some reason. So I tried to reproduce it in a small example. I finally reproduced it by dereferencing a std::shared_ptr and used the auto keyword. Strangely the autocomplete and tooltips are working fine, but following does not.

      I explicitly tried different QtCreator versions (8, 9, 10) and only version 7 worked for me.

      Here the example:

      #include <iostream>
      #include <memory>
      
      class ATest
      {
      public:
          void someMethod() const
          {
              std::cout << "test" << std::endl;
          }
      };
      
      int main(int argc, char *argv[])
      {
          const auto a1 = std::make_shared<ATest>();
          const auto& a2 = *a1;
          const ATest& a3 = *a1;
          a1->someMethod(); // works!
          a2.someMethod();  // does NOT jump to implementation
          a3.someMethod();  // works!
      
          const auto b1 = new ATest;
          const auto& b2 = *b1;
          const ATest& b3 = *b1;
          b1->someMethod(); // works!
          b2.someMethod();  // works!
          b3.someMethod();  // works!
      
          return 0;
      } 

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            voodoo66 Voodoo Master
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes