class Foo { private: Foo(int){}; public: static void foo(); }; void Foo::foo() { Foo f1; //illegal Foo f2(1); //legal } int main() { }
Standard input is empty
prog.cpp: In static member function 'static void Foo::foo()': prog.cpp:12:8: error: no matching function for call to 'Foo::Foo()' prog.cpp:4:5: note: candidates are: Foo::Foo(int) prog.cpp:2:1: note: Foo::Foo(const Foo&)
Standard output is empty