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.

Bug 270874 - Do not show friend (forwad) class declarations in class hierarchy view
Summary: Do not show friend (forwad) class declarations in class hierarchy view
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-14 06:44 UTC by Vladimir Kvashin
Modified: 2017-07-20 17:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2017-06-14 06:44:08 UTC
Open llvm39 project. Go to SymbolTableListTraits class (SymbolTableListTraits.h:71). View hierarchy. It shows ~7 specializations.
But when you click to each one, you get to a declaration like
friend class SymbolTableListTraits<BasicBlock>;

That's very frustrating.
Comment 1 Vladimir Kvashin 2017-06-14 06:52:22 UTC
The "T" annotation in the left editor gutter behaves exactly the same.
A simple example is shown below

template <typename NodeTy> struct ilist_embedded_sentinel_traits {
    void some_stuff();
};

template<typename NodeTy>
class ilist_node {
  friend struct ilist_embedded_sentinel_traits<NodeTy>;
  void some_other_stuff();
};
Comment 2 Vladimir Kvashin 2017-06-14 07:32:22 UTC
Another example that shows this (compilable and even runnable).
Moreover, in this example ONLY forward is shown, but traits<Function> and traits<Variable> are not.

#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;
}
Comment 3 Vladimir Kvashin 2017-06-14 07:51:21 UTC
(In reply to Vladimir Kvashin from comment #2)
> Moreover, in this example ONLY forward is shown, but traits<Function> and
> traits<Variable> are not.

That's quite a different problem. I mixed "class" and "struct" in the code in comment #2, this made model behave that way. It's a different probleml; I've just submitted an issue #270875 in this respect.

The correct example for this issue is as follows.

#include <iostream>

using namespace std;

class Function {};
class Variable {};

template <typename NodeTy> class traits {
public:
    static void echo() { cout << "Generic" << endl; }
};

template<typename NodeTy> class list {
public:    
  friend class traits<NodeTy>;
  void some_other_stuff();
};

template <> class traits<Function> {
public:    
    static void echo() { cout << "Function" << endl; }
};

template <> class traits<Variable> {
public:    
    static void echo() { cout << "Variable" << endl; }
};

int main(int argc, char** argv) {
    traits<int>::echo();
    traits<Function>::echo();
    traits<Variable>::echo();
    return 0;
}
Comment 4 Vladimir Kvashin 2017-06-14 08:45:13 UTC
Fixed in cnd-main
http://hg.netbeans.org/cnd-main/rev/8e56290210ce
Comment 5 Quality Engineering 2017-07-20 17:52:02 UTC
Integrated into 'main-silver', will be available in build *201707201608* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8e56290210ce
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #270874 - Do not show friend (forwad) class declarations in class hierarchy view