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 222821 - overloaded pointer to member
Summary: overloaded pointer to member
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-27 13:11 UTC by soldatov
Modified: 2016-10-31 10:12 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 2012-11-27 13:11:58 UTC
inaccuracy tests marks "&::S1::s1" as invalid identifier
In simple case I don't have any invalid identifier, but code completion and refactoring works wrongly

Code:
#include <iostream>
using namespace std;
struct S1 {
    int s1;
    S1(int s1_) : s1(s1_) {}
};

struct S2 {
    int s2;
    S2(int s2_) : s2(s2_) {}
    operator int S1::*() {
        return &::S1::s1;
    }
};

int main() {
    S1 s_1(7);
    S2 s_2(0);
    cout << s_1.*(int S1::*)s_2 << endl;
    return 0;
}

1st problem: press Ctrl+Space after "return &::S1::" ==> No suggestions
2nd problem:
 move cursor on "struct S1" and press Ctrl+R
 type S1__
 press Refactor button
 rebuild project
 ==> build fails