This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28539] New: granted access to private nested class
- From: "dushistov at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jul 2006 06:03:32 -0000
- Subject: [Bug c++/28539] New: granted access to private nested class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
g++ compile such code without any warrnings:
class C {
private:
class N {
public:
N(int val) { this->value = val; }
int getValue() { return value; }
private:
int value;
};
N nO;
public:
C() : nO(17) {}
N &getNestedPrivateObject() {
return nO;
}
};
int main()
{
C o;
return o.getNestedPrivateObject().getValue();
}
--
Summary: granted access to private nested class
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dushistov at mail dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28539