The following code:
struct A { int f(int); auto g(int x) -> decltype(f(x)); };
Fails to compile with the error:
erro
Here are the magic words:
struct A { int f(int); auto g(int x) -> decltype((((A*)0) ->* &A::f)(x)) ; };
Edit I see from Mikael Persson's answer that this is how it's done in boost.