https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- And template <int N> int foo (void) { return N; } template <> int foo <42> (void) { return -42; } int a = foo<15> (); int b = foo<42> (); works the same, _Z3fooILi15EEiv is comdat exported weak, _Z3fooILi42EEiv is non-weak global non-comdat.