You can give an explicit template argument:
bar(3, foo);
or cast the ambiguous function name to a type from which the template argument can be deduced:
bar(3, static_cast(foo));
or wrap it in another function (or function object) to remove the ambiguity
bar(3, [](int x){return foo(x);});