Consider the code below. I'm trying to write rather complex template which in turn accepts a template parameter. Seems that KDevelop is completely unaware of such syntax, so it could not provide any completion for it. It does not matter what actual contents are used. Neither fields nor functions are completed. template<typename T> class Parameter { std::vector<T> param_field; }; template < template<typename> TemplateParam > class Example { // completing type passed as parameter typedef TemplateParam<int> SpecializedParam; // using typedef to define a field SpecializedParam field; }; void foo() { // Instantiating outer template Example<Parameter> instance; // trying to invoke field completion (| is the cursor) instance.| }
Sorry, by bad. Provided example was written by simplifying a real code, but I just oversimplified it. In order to reproduce the bug we need to make fields public and try to access param_field. So either s/class/struct/g or add 'public:'. Also we need to modify the last line as: instance.field.| It shows that `instance.field' is detected as SpecializedParam, but no further completion or code assist is provided when we try `instance.field.|'
Missed the `class' keyword before TemplateParam. P.S.: Need more sleep though...
so is there a bug or not? please close this if the issue went away by getting more sleep :) otherwise, please attach an updated code snippet. though maybe even then safe your time, since this is fixed with kdev-clang which will supersede our old c++ language plugin soon.
Wow, kdev-clang sounds pretty cool. Looking forward to see it in the next release :) Well, I'll fix the code snippet nevertheless. The following code is compiling and working perfectly, still code highlight/completion is not working as one may expect: #include <iostream> #include <vector> template<typename T> struct Parameter { std::vector<T> vector_field; T get_first() { return vector_field.front(); } }; template < template<typename> class TemplateParam > struct Example { // completing type passed as parameter typedef TemplateParam<int> SpecializedParam; // using typedef to define a field SpecializedParam field; }; int main(int argc, char** argv) { // Instantiating outer template Example<Parameter> instance; // Using inner template type instance.field.vector_field.push_back(42); std::cout << instance.field.get_first() << std::endl; } Neither `vector_field.push_back(42);' nor '.get_first()' is highlighted. As I see, it's very hard to deal with template features in internal C++ parser, so it's probably never happen. Well, waiting for kdev-clang :) P.S.: Thank you guys, you're doing fantastic job and an awesome IDE! In my opinion, KDevelop is just the best, because it simply doing it's job without bitching and complaining here and there as other IDEs often do. Just thanks!
just checked again, with kdev 5.0 I don't see any obvious issues here anymore, you even get code completion.