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 182311 - Members of C++ private classes aren't found if using namespace
Summary: Members of C++ private classes aren't found if using namespace
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P4 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-18 14:19 UTC by czw
Modified: 2013-05-07 11:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Simple source file that will show two validation errors in NetBeans (530 bytes, application/octet-stream)
2010-03-18 14:20 UTC, czw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description czw 2010-03-18 14:19:38 UTC
When creating a private class in C++ and using namespaces, the members aren't found. The example file attached will trigger the code validation error, even though the code is correct.
Comment 1 czw 2010-03-18 14:20:38 UTC
Created attachment 95377 [details]
Simple source file that will show two validation errors in NetBeans
Comment 2 nnnnnk 2010-03-24 18:17:24 UTC
Example from attachment:

namespace test {
class TestClass {
public:
    TestClass();
    TestClass(const TestClass& orig);
    virtual ~TestClass();
private:
    class Private;
    Private *d;
};
}

using namespace test;

class TestClass::Private { // NetBeans won't find the Private identifier
public:
    int unresolved_identifier;
};

TestClass::TestClass() { d = new Private; }
TestClass::TestClass(const TestClass& orig) { d = new Private; }
TestClass::~TestClass() {
    int this_will_be_flagged_as_wrong = d->unresolved_identifier;
    delete d;
}
Comment 3 nnnnnk 2010-03-25 12:10:46 UTC
Here is inner class definition in different namespace with parent class.

It's rare scenario and it's very time expensive to search definition for declaration in whole project.