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

Code completion Problem with templates and operators

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 1.3.0
    • Qt Creator 1.2.90
    • Editors
    • None
    • 213316f2a7feb2bb62fb281a975d2b0d1d03b08b

    Description

      Platform details
      Ubuntu, Qt 4.6 TP1, Qt Creator 1.2.91 (compiled from git on 30/09/2009)
      Compilers
      GCC
      Compiler details
      4.4
      Subject
      Code completion Problem with templates and operators
      Steps to reproduce / test case

      #include <iostream> 
      
      using std::cout; 
      using std::endl; 
      
      class TestClass 
      { 
      public: 
          void printSomething(); 
      }; 
      
      void TestClass::printSomething() 
      { 
          cout << "Hello, World!" << endl; 
      } 
      
      template<typename T> 
      class Ptr 
      { 
      private: 
          T* m_Pointer; 
          
      public: 
          Ptr( T *instance ) 
          { 
              m_Pointer = instance; 
          } 
          
          T* operator->() 
          { 
              return m_Pointer; 
          } 
      }; 
      
      class PtrTestClass 
      { 
      private: 
          TestClass *m_Pointer; 
          
      public: 
          PtrTestClass( TestClass *instance ) 
          { 
              m_Pointer = instance; 
          } 
          
          TestClass* operator->() 
          { 
              return m_Pointer; 
          } 
      }; 
      
      int main( int argc, char **argv ) 
      { 
          TestClass *t = new TestClass(); 
          Ptr<TestClass> p( t ); // No constructor code completion is shown 
          p->printSomething(); // No class help is shown after -> 
          
          PtrTestClass pt( t ); // Code completion gives hint about constructor 
          pt->printSomething(); // Also no code completion after -> 
      }
      

      More information
      Seems like the code completion has problems with:
      *) Templates
      *) Overloaded "->" Operator
      The example above demonstrates the problem.

      Attachments

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

        Activity

          People

            raggi Roberto Raggi
            dajansen Damian Jansen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes