https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105481
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> --- Here's a closely related rejects-valid (rather than ICE-on-valid) testcase, where the default argument is now T instead of uint<N> (which shouldn't affect the outcome of partial ordering): template<unsigned> struct uint; template<unsigned N> uint<N> f(const uint<N> &); // #1 template<unsigned N, typename T, typename = T> uint<N> f(T); // #2 using X = uint<1>; X (*fp)(X const &) = f; // should use #1, instead diagnoses as ambiguous