Version: SVN (using Devel) OS: Linux When adding a template function to a class. When you let KDevelop automatically create the function for you. It does create the function but forgets to add the template<..........> part to the function. Reproducible: Always Steps to Reproduce: 1. Create a class. 2. Add a template function. 3. Hit Ctrl+space and highlight to function to generate the function Actual Results: Fails to add the template<.........> to the function.
please add the test-code so we don't have to reinvent it
// START CODE class Test { template <typename T> void someFuction(T arg); }; // END CODE Steps to reproduce: 1. Write Test (or a part of it) and request code completion. 2. Select Implement void someFuction(T arg) … Expected result: template <typename T> void Test::someFuction(T arg) { } Result you get: void Test::someFuction(T arg) { }
The same goes for class templates. Request implementation of someFunction with the following code: // CODE template <typename T> class Test { void someFuction(T arg); }; // END CODE Expected result: // CODE template<typename T> void Test< T >::someFuction(T arg) { } // CODE END Result you get: // CODE void Test< T >::someFuction(T arg) { } // CODE END
still valid in the clang backend, there we get: template<T> void Test<T>::someFuction(T arg) { } note the missing "typename" in the `template<T>` part