https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100825
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- Yes, I realise that, but I think that is the same rule that means you can't change the result of overload resolution for a given call, which is why the second definition gets emitted using the same symbol name as the first. If the constrained overload is declared before the first call to foo<int>() then there is no error.