https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118944
--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> --- > As far as I know, these functions shouldn't even be being instantiated yet, > yet they appear to be. It's not required by the standard, but GCC checks non-dependent expressions ahead of time in order to proactively diagnose IFNDR template definitions that could never produce a valid specialization ([temp.res.general]/6). So I guess it boils down to whether f<char> is considered type-dependent? I don't think it is, at least according to [temp.res.expr]/3, so we should in theory be able to check the call ahead of time, but it seems something is going wrong after we partially substitute the explicit template arguments {char} into the template during template argument deduction.