[Bug c++/40649] New: Class access violations
ivranos at freemail dot gr
Sat Jul 4 13:31:00 GMT 2009
The compiler allows violations of access control in classes. This is a major
The following code should not compile, but it compiles:
// The code is a modified version of the code of TC++PL3, page 852, Appendix C.
typedef int T;
T y; // This should be flagged as an error since T is in private
section of class Outer.
void f(Outer *p, int v);
void Outer::Inner::f(Outer *p, int v)
p->i= v; // This should be flagged as an error since p->i is a private
member of class Outer,
// and class Inner should not have access to it.
Summary: Class access violations
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ivranos at freemail dot gr
GCC host triplet: gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) - Ubuntu 9.04
GCC target triplet: gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) - Ubuntu 9.04
More information about the Gcc-bugs