#include <iostream> class A { static void Method() { std::cout << "method called."; } }; class B : public A { // Has a bunch of stuff but not "Method" }; int main() { B::Method(); }
Standard input is empty
prog.cpp: In function ‘int main()’:
prog.cpp:5:16: error: ‘static void A::Method()’ is private
static void Method() { std::cout << "method called."; }
^
prog.cpp:15:14: error: within this context
B::Method();
^
Standard output is empty