sfinae0.cpp:15:5: error: call to 'doSomething' is ambiguous doSomething( a ); ^~~~~~~~~~~ sfinae0.cpp:3:6: note: candidate function [with T = A] auto doSomething( T &t ) -> decltype( t.doSomething() ) { ^ sfinae0.cpp:7:5: note: candidate function [with T = A] int doSomething( T &t ) { ^ 1 error generated.