You can give an explicit template argument:
bar<int(int)>(3, foo);
or cast the ambiguous function name to a type from which the template argument can be deduced:
bar(3, static_cast<int(*)(int)>(foo));
or wrap it in another function (or function object) to remove the ambiguity
bar(3, [](int x){return foo(x);});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…