Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
Qt Creator 4.9.0-beta1, Qt Creator 13.0.0-beta1
-
None
-
8ee97b1e0 (13.0)
Description
Consider a simple template class:
namespace ns { template<typename T> class MyClass { public: void bar(); void foo(T arg); }; }
When using refactoring on foo() to generate the implementation of the method outside the class the Qt Creator generates the following incorrect code:
template<typename T> void MyClass::foo(ns::T arg) { }
There are two problems with this:
1) The template argument is missing in the class name. It should be
MyClass<T>::
2) The name of the namespace is being inserted as a qualifier for the template argument for some reason (this does not happen when the class is NOT in a namespace). It should be
MyClass<T>::foo(T arg)
Furthermore if I generate the implementation for bar() AFTER foo() the previous method's beginning is incorrectly detected and the template line ends up above the new definition like this:
template<typename T> template<typename T> void MyClass::bar() { } void MyClass::foo(acore::T arg) { }
This requires a lot of manual fixing after generating the code.
Attachments
Issue Links
- mentioned in
-
Page Loading...