fork download
  1. struct A {
  2. void foo() {}
  3. };
  4.  
  5. struct B :private A {
  6. };
  7.  
  8. int main() {
  9. B b;
  10. b.foo();
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:2:10: error: 'void A::foo()' is inaccessible
prog.cpp:10:10: error: within this context
prog.cpp:10:10: error: 'A' is not an accessible base of 'B'
stdout
Standard output is empty