void f0(int = 5) {} void f1(int = 2) {} void f_(int) {} template<typename T> void back_forth(T * y) { reinterpret_cast<T *>(reinterpret_cast<void (*)()>(y))(); } int main() { //back_forth(f_); //fails! back_forth(f0); back_forth(f1); back_forth(f_); //succeeds! } In addition, the call to f1 inside back_forth(f1) thinks the argument is 5, not 2.
This is a dup of bug 4205, the reinterpret_cast is not needed. *** This bug has been marked as a duplicate of 4205 ***