xxxxxxxxxx
error: ‘void A::ohai()’ is inaccessible
struct A { void ohai() {} };
^
main.cpp:20:11: error: within this context
B().ohai();
^
main.cpp:8:17: error: ‘void A::ohai()’ is inaccessible
struct A { void ohai() {} };
^
main.cpp:22:11: error: within this context
D().ohai();
xxxxxxxxxx
struct A { void ohai() {} };
struct B: protected A {};
struct C: private A { friend int main();};
struct D: B { void test() { ohai();} };
struct E: C { void test() { ohai();} };
int main() {
A().ohai();
B().ohai();
C().ohai();
D().ohai();
return 0;
}