struct foo { int f(); }; int main() { void* p = static_cast<void*>(&foo::f); }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:6: error: invalid static_cast from type ‘int (foo::*)()’ to type ‘void*’ prog.cpp:6: warning: unused variable ‘p’
Standard output is empty