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

Clang Code Model separate template definition failure

    XMLWordPrintable

    Details

      Description

      Hi,

      when using QtC 4.7 with Clang Code Model, the code is not properly parsed when providing an out-of-class definition of a method template.

      The issue can be reproduced with the following code:

      #include <QCoreApplication>
      
      template <class X, class Y, class Z>
      class TemplateA
      {
      public:
      explicit TemplateA();
      };
      
      template< class X, class Y, class Z >
      TemplateA< X, Y, Z >::TemplateA()
      {
      
      }
      
      template< class X, class Y >
      class TemplateB : public TemplateA< X, Y, TemplateB< X, Y > >
      {
      public:
      explicit TemplateB();
      };
      
      template< class X, class Y >
      TemplateB< X, Y >::TemplateB()
      {
      
      }
      
      int main(int argc, char *argv[])
      {
      QCoreApplication a(argc, argv);
      
      return a.exec();
      }
      
      

      When scrolling down the methods list, the method signature is reported like

      c:@ST>3#T#T#T#@TemplateA::TemplateA<X, Y, Z>() -> void
      

      That spoils the whole parsing, cause some other methods are reported with the wrong signature, or you see a "const int myVariable" when you're in a specific method (so I assume that the parsing is completely out-of-sync).

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              yvvan Ivan Donchevskii
              Reporter:
              becrux Antonio Di Monaco
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes