template< bool > struct enable_if { typedef void (*t)(); }; struct c { template< bool t = true > operator typename enable_if< t >::t () { return []{}; } }; int main() { c()(); // error: no match for call to ‘(c) ()’ } http://stackoverflow.com/questions/11018810 In C++03 it seems that it was impossible to define a conversion function template that would render its class Callable. Yet there is a function add_template_conv_candidate (cp/call.c) which seems to be used only for this purpose. It was added back in 1997 and it's not clear that it's been tested in a while. Now with default function template arguments the above construct is possible, and it should be called but isn't. The problem is that the test for function pointer type (etc.) is applied before instantiation in build_op_call_1. The test probably belongs in add_conv_candidate.
I don't think this is a bug. GCC, ICC and clang all reject it the same way. MSV rejects it with: <source>(10): error C2783: 'c::operator enable_if<__formal>::t(void)': could not deduce template argument for 't'
(In reply to Andrew Pinski from comment #1) > I don't think this is a bug. Right, the behavior looks correct. As for a nested-name-specifier working in this context, it works if it's not dependent. As for the declaration being a function template, it works as long as the conversion-type-id is not dependent. Oddly, a dependent conversion-type-id *is* allowed when the function is not templated. Anyway, the standard says to inspect the conversion function declarations and find the ones referring to function (-pointer, -reference) types. That doesn't admit application of template default arguments, as implicit or explicit conversion does.
(The standardese mentions "for each … where the conversion-type-id denotes a type" which excludes the case of being a dependent type.)