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 - IDE doesn't differ "operator int ()" from "operator int () const"
Summary: IDE doesn't differ "operator int ()" from "operator int () const"
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.2
Hardware: PC Solaris
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-19 12:24 UTC by soldatov
Modified: 2017-03-31 18:29 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 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