Proposed resolution (October, 2005): Change the last sub-bullet of 13.10.3 [temp.deduct] paragraph 2
as indicated: Attempting to create a function type in which a parameter
has a type of void , or in which the return type is a
function type or array type.
According to 13.10.3 [temp.deduct] paragraph 2, That would seem to apply to cases like the following: Here, the return type of f is deduced as
int[5] , which is invalid according to 9.3.4.6 [dcl.fct] paragraph 6. The outcome of this example, then,
should presumably be that type deduction fails and overload
resolution selects the non-template function. However, the list
of reasons in 13.10.3 [temp.deduct] for which type
deduction can fail does not include function and array types as a
function return type. Those cases should be added to the
list.
If a substitution in a template parameter or in the function type
of the function template results in an invalid type, type
deduction fails.
template <class T> T f(T&){}
void f(const int*){}
int main() {
int a[5];
f(a);
}