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

QtCreator hangs up while Following Symbol Under Cursor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • Qt Creator 4.0.0
    • Qt Creator 4.0.0-rc1, Qt Creator 4.0.0
    • C/C++/Obj-C++ Support
    • None
    • Kubuntu

    Description

      Here is example of code

      #include <utility> // for std::move
      
      template <class, class&gt;
      class TNode;
      template <class, class&gt;
      class TMetaNode;
      
      template <class UD, class Tie>
      class TTraits {
      public:
         using TTie          = Tie;
         using TNodeType     = TNode<UD, TTie>;
         using TMetaNodeType = TMetaNode<UD, TTie>;
      };
      
      // ----------------------------------------------------------------------------------------------------
      
      template <class T, class SomeTie>
      class TMetaNode {
      public:
         typedef TTraits<T, SomeTie> TTraitsType;
         void SetBranchAccessSettings(int &&BranchSettings) {}
      };
      
      // ----------------------------------------------------------------------------------------------------
      
      template <class T, class SomeTie>
      bool AllCopiesHaveTheSameStatus() {
         typedef TMetaNode<T, SomeTie> TMetaNodeType;
      }
      
      // ----------------------------------------------------------------------------------------------------
      
      template <class UD, class SomeTie>
      class TNode {
      public:
         using TTraitsType = TTraits<UD, SomeTie>;
         void SetBranchAccessSettings(int &&BranchSettings) noexcept;
         typename TTraitsType::TMetaNodeType *d;
      };
      
      template <class UD, class SomeTie>
      void TNode<UD, SomeTie>::SetBranchAccessSettings(int &&BranchSettings) noexcept {
         d->SetBranchAccessSettings(std::move(BranchSettings));
      }
      

      Now, press F2 at SetBranchAccessSettings in this line:

         d->SetBranchAccessSettings(std::move(BranchSettings));
      

      According to gdb, QtCreator hangs in while loop in LookupContext.cpp

                  if (fun->name() && fun->name()->isQualifiedNameId()) {
                      if (ClassOrNamespace *binding = bindings()->lookupType(fun)) {
                          candidates = binding->find(name);
      
                          // try find this name in parent class
                          while (candidates.isEmpty() && (binding = binding->parent()))
                              candidates = binding->find(name);
      
                          if (! candidates.isEmpty())
                              return candidates;
                      }
                  }
      

      Attachments

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

        Activity

          People

            kosjar Nikolai Kosjar
            dimanne DimanNe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes