1 2 3 4 5 6 7 8 | struct foo { int f(); }; int main() { void* p = static_cast<void*>(&foo::f); } |
c3RydWN0IGZvbyB7CiAgICBpbnQgZigpOwp9OwoKaW50IG1haW4oKSB7CiAgICB2b2lkKiBwID0gc3RhdGljX2Nhc3Q8dm9pZCo+KCZmb286OmYpOwp9Cg==
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’
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


