https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116223
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> --- We're effectively rejecting this under https://eel.is/c++draft/temp#deduct.type-20 If P has a form that contains <i>, and if the type of i differs from the type of the corresponding template parameter of the template named by the enclosing simple-template-id, deduction fails. Here P is B<X>, which is functionally equivalent to A<(unsigned char)X>, and under the quote above the type (unsigned char) of i differs from the type (int) of A's T parameter. This is also closely related to CWG2037 and other issues with the semi-transparency of alias templates. I have drafting for these that needs further revision. We could make this work by looking through the IMPLICIT_CONV_EXPR in unify. It's not clear to me that this should work, but since that has been the universal existing practice (https://godbolt.org/z/PrY5hnczj), perhaps it's more friendly to make it work. Is this example reduced from some real code?