https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121117
--- Comment #2 from Tobias Loew <tobias.loew at steag dot com> --- By looking once more very close at the standard, I figured out that for the given example, the two "foo" overloads are unordered wrt. partial template ordering: the reason is the last sentence in https://eel.is/c++draft/temp.deduct.type#9 and the following p9.2. Thus, IMHO, the result of the overload resolution has to be ambiguous.