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

Refactor -> add definition in X.cpp: template arguments discarded when using nested classes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 2.8.0-rc, Qt Creator 2.8.0
    • Fedora 17

    Description

      Steps to reproduce:

      • Create new project
      • Add class Foo
      • Modify the header:
        Foo.h
        #include <list>
        
        class Bar;
        using namespace std;
        
        class Foo
        {
        public:
          Foo();
          list<Bar> baz();
          void baz2(list<Bar> bar);
          list<Bar>::iterator baz3();
          void baz4(list<Bar>::iterator bar);
        };
        
      • Use "right click -> refactor -> add definition in Foo.cpp" for all 4 added methods
      • The generated code goes as such:
        Foo.cpp
        #include "foo.h"
        
        Foo::Foo(){} // Fine
        list<Bar> Foo::baz(){} // Fine
        void Foo::baz2(list<Bar> bar){} // Fine
        list::iterator Foo::baz3(){} // Missing template argument
        void Foo::baz4(list::iterator bar){} // Missing template argument
        

      The same thing happens when using "add definition outside class"

      Attachments

        Issue Links

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

          Activity

            People

              kandeler Christian Kandeler
              khaur Khaur
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes