Version: (using KDE 4.4.2) OS: Linux Installed from: Fedora RPMs There is a template class with two parameters: template <typename T1, typename T2> class effective_pair : public T1, public T2 { typedef T1 first_type; typedef T2 second_type; }; and a partial specialization of that class: template <typename T2> class effective_pair<void, T2> : public T2 { typedef void first_type; typedef T2 second_type; }; Now I type this in main.cpp, #include'ing the above definition: typedef effective_pair and get code completion with both classes listed. Then I select the partially specialized variant, hit enter and KDevelop inserts this code: typedef effective_pair< void, T2 ><> with the cursor being inside the last two angle brackets. This code is incorrect and does not compile. I expect to see this: typedef effective_pair< void, /*cursor waiting for the second class name*/ >
And it looks like that in the code completion list: class effective_pair< void, T2 ><class T2> This is not quite correct in my opinion. It should be something along the lines of: class effective_pair< void, class T2 > similar to how non-specialized template classes are displayed: class effective_pair< class T1, class T2 >
This bug is still present in the recent master.
Git commit dcc458b53c7d2cec085de8c23ac6d2d231f35f40 by Olivier JG. Committed on 28/10/2012 at 14:21. Pushed by olivierjg into branch 'master'. Don't generate double template identifiers for specializations during code completion. TODO: It would be nice to have the cursor at the first required template parameter in specializations. M +21 -26 languages/cpp/codecompletion/item.cpp http://commits.kde.org/kdevelop/dcc458b53c7d2cec085de8c23ac6d2d231f35f40