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

Clang: No completion involving templated "using" in template class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 4.11.0-beta1
    • C/C++/Obj-C++ Support
    • Linux/X11

    Description

      Consider the simple code below:

      #include <vector>
      
      template<typename real = double>
      class TestClass {
      public:
          template<typename T>
          using ArrayType = std::vector<T>;
      private:
          ArrayType<real> testMember;
      public:
      
          void test() {
              testMember. // <--- try auto-completion here with ClangModel enabled
                          //(should not work.) Then try it with disabled
                          //(should work).
          }
      
      };
      
      

      When trying autocompletion with ClangCodeModel enabled in the part of the code where the comment specifies, it does not work. Turning ClangCodeModel off, autocompletion works. 

      A simple change to the code above causes it to work with ClangCodeModel:

      #include <vector>
      
      class TestClass {
      public:
          template<typename T>
          using ArrayType = std::vector<T>;
      private:
          ArrayType<double> testMember;
      public:
      
          void test() {
              testMember. // <--- try auto-completion here with ClangCodeModel                 
                          // enabled (should work now.)
          }
      
      };
      
      

       At the very least this is inconsistent. In the worst case, this is a bug in the ClangCodeModel plugin.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            vvhitedog vvhitedog
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes