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 268586

Summary: IDE doesn't differ "operator int ()" from "operator int () const"
Product: cnd Reporter: soldatov <soldatov>
Component: Code ModelAssignee: petrk
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description soldatov 2016-10-19 12:24:12 UTC
C++ Code:
#include <iostream>

using namespace std;

class A {
public:
  int i;
  A(int i) : i(i) {}
  operator int () const { return 10; }
  operator int () { return 11; }
  int foo() const { return 12; }
  int foo() { return 13; }
};

int main(int argc, char** argv) {
    int i;
    const A a1(1);
    A a2(1);

    i = a1;
    cout << i << endl;
    cout << a1.foo() << endl;
    i = a2;
    cout << i << endl;
    cout << a2.foo() << endl;

    return 0;
}

Problems:
1) in Navigator I see 2 same "operator int()" items
2) in Classes I see 1 "operator int()" item only