This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The following example shows that code model erroneously distinguishes structs and classes. There is a slight inconsistency in code: traits sometimes is class and sometimes is struct. But from C++ point of view it's ok. It compiles without warnings and works well. However IDE does not show traits<Function> and traits<Variable> in the list of specializations. That's because their kinds are different => they can not be properly found in code model maps. Sure this fact has more consequences. #include <iostream> using namespace std; class Function {}; class Variable {}; // has a gray "T" but navigates ONLY to the line 16 template <typename NodeTy> struct traits { public: static void echo() { cout << "Generic" << endl; } }; template<typename NodeTy> class list { public: friend struct traits<NodeTy>; void some_other_stuff(); }; template <> class traits<Function> { // has a green "T" public: static void echo() { cout << "Function" << endl; } }; template <> class traits<Variable> { // has a green "T" public: static void echo() { cout << "Variable" << endl; } }; int main(int argc, char** argv) { traits<int>::echo(); traits<Function>::echo(); traits<Variable>::echo(); return 0; }
Fixed in cnd-main http://hg.netbeans.org/cnd-main/rev/8e56290210ce
(In reply to Vladimir Kvashin from comment #1) > Fixed in cnd-main > http://hg.netbeans.org/cnd-main/rev/8e56290210ce Sorry, I meant issue #270874
Created attachment 164545 [details] Proposed fix
I'm pretty sure that we should change Utils.getCsmDeclarationKindkey() so that it returns the same prefix for classes and structs. Crunches we discussed yesterday look horrible, change many places in code instead of fixing the one that is the root cause... yuk.