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.
Summary: | Find Usages: class field initializers in ctor are treated as "read" instead of "write" access. | ||
---|---|---|---|
Product: | cnd | Reporter: | Vladimir Kvashin <vkvashin> |
Component: | Code Model | Assignee: | Alexander Simon <alexvsimon> |
Status: | VERIFIED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Sample code |
fixed on enum, branch release82, changeset ad8717ba30e5 Integrated into 'main-silver', will be available in build *201704020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/a1f9e5cbde14 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #269821 Find Usages: class field initializers in ctor are treated as "read" instead of "write" access. (transplanted from ad8717ba30e51cb01010ab7bb04b25ad9e10de1b) https://netbeans.org/bugzilla/show_bug.cgi?id=269821 Changesets: http://hg.netbeans.org/releases/rev/ad8717ba30e5 # fixed Bug #269821 Find Usages: class field initializers in ctor are treated as "read" instead of "write" access. Verified in netbeans-8.2-20170424. |
Created attachment 163630 [details] Sample code Consider the following code: class TestClass { const char* value; public: TestClass() : value(nullptr) { // this is WRITE access! cout << "Default ctor" << endl; }; TestClass& operator=(const TestClass&& other) { value = strdup(other.value); cout << "Move " << value << endl; return *this; } }; Try to find usages of value. All usages are found OK. Switch "read" access (green button) off. Usage in constructor initializer disappears. But it is write access.