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

Move definition of a template member to impl file fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • Qt Creator 4.14.0-beta2
    • Qt Creator 4.13.2
    • C/C++/Obj-C++ Support
    • None
    • Linux ubuntu 20.04, creator 4.13.2, qt 5.15.1
    • d2ebc16b92cfe10eff6b379b32cb0e07329f29df (qt-creator/qt-creator/4.14)

      When using the "move to implementation file" command to move the definition of a method of a template out of the header, creator generates an incorrect signature.

      Given the code below:

      template <typename T>
      {{ class Delegate}}
      {{ {}}
      {{ public:}}
      {{ void Invoke()}}
      {{ {}}
      {{ }}}
      {{ };}}template <typename T>
      {{ class SomeClass}}
      {{ {}}
      {{ Delegate<void(int)> _d;}}public:
      {{ SomeClass(Delegate<void(int)>)}}
      {{ {}}} qtcbug.cpp
      {{ };}}

      Move the definition of the SomeClass ctor into its implementation file.

      The generated result is: 

      template<typename T>SomeClass::SomeClass(Delegate<void (int)>){} 

      which should be:

      template<typename T> SomeClass<T>::SomeClass(Delegate<void (int)>) 

       

        1. qtcbug.cpp
          0.4 kB
          Jake Helfert
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kandeler Christian Kandeler
            qtjake Jake Helfert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes