Community
Participate
Working Groups
I am working on a small "Standard Make" project with about 300 source files. CDT often refuses to find declarations of members with the "Open Declaration" command. Refactoring also works hardly never. CDT functionality is unfortunately as less useful for me as a simple text editor. I managed to write a very simple program that leads to a "Open Declaration" failure: a template class is used to make a second class be a singleton. If the static member INSTANCE is defined in .cpp, the "Open Declaration" does not work on "MyClass::mb" member. This command appears to work well on other symbols of this program. Here are the simplest header and source file I used: this code compiles with g++ 4.0.1 ---------main.h #ifndef MAIN_H_ #define MAIN_H_ namespace MyNamespace { class MyClass; template<class T> class Singleton; } template <class T> class MyNamespace::Singleton // If the declaration is enclosed in "namespace MyNamespace {}" CDT works well. { public: static T *INSTANCE; }; class MyNamespace::MyClass : public MyNamespace::Singleton<MyNamespace::MyClass> { private: int mb; public: MyClass(); ~MyClass(); }; #endif /*MAIN_H_*/ -----------main.cpp #include "main.h" using namespace MyNamespace; template<> MyClass *Singleton<MyClass>::INSTANCE = 0; // The problem disappear if this line is commented out. MyClass::MyClass() { this->mb = 2; // The "Open Declaration" command does not work on "mb". } int main() { }
I'm not sure I'll get this fixed in time for 3.1. Hopefully soon after, though.
Works with 4.0, marking as fixed.