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

Code Completion does not work for operator-() result with internal code model

    XMLWordPrintable

Details

    • Windows

    Description

      Some code excerpt of the attached project:

      // operator- returns a DoubleDiff
      DoubleDiff Double::operator-(const Double& sub) const
         {
         return DoubleDiff(_double - sub._double);
         }
      
      // DoubleDiff has a method double diff() const;
      
      Double d1(100.);
      Double d2(50.);
      
      double diff = (d1-d2).diff();

       

       

      If you place the cursor on diff() it is not detected as method of DoubleDiff.

      If you write (d1-d2). and then request Ctrl+Space code completion you will get the mtehods of Double, but not of DoubleDiff.

      Comment: With clangd code model this works.

       

      Attachments

        1. Test_02.zip
          1 kB
          Michael Möllney

        Activity

          People

            kandeler Christian Kandeler
            moellney Michael Möllney
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: