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 249981 - function<...> can not be refactored
Summary: function<...> can not be refactored
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: PC Solaris
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-23 14:29 UTC by soldatov
Modified: 2016-10-31 11:00 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 2015-01-23 14:29:50 UTC
C++11 sample:
#include <functional>
#include <iostream>
 
using namespace std;

void f(int a1, int a2, int a3) {
    std::cout << "Arg1 = " << a1 << endl;
    std::cout << "Arg2 = " << a2 << endl;
    std::cout << "Arg3 = " << a3 << endl;
}
 
int main() {
    function<void(int)> bf = bind(f, placeholders::_1, 0, 0);
    bf(1);
    bf(2);
    bf(3);
    return 0;
}

Problems:
1) bf has "Unused variable" sign
2) Find Usages can not find bf(1), bf(2), bf(3)
3) Rename doesn't work. Such message appears: "Cannot modify element in read only or library file: "functional"."
Comment 1 soldatov 2015-01-23 14:41:01 UTC
This sample can be compiled via Oracle Solaris Studio too:

#include <functional>
#include <iostream>
 
using namespace std;

void scan(int length, std::function<void()> process )
{
  for(int i=0; i<length; i++) {
      process();
  }
}

int main() {
    std::function<void()> lll = []()->void { cout << "ok" << endl; };
    scan(10,  lll);
    lll();
    return 0;
}