https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106825
--- Comment #3 from Mark Millard <markmigm at gmail dot com> --- (In reply to Mark Millard from comment #2) . . . > export module module_template_specialization_intf; > > export template<int c> int test(); > export template<> int test<0>() { return -1; }; > export template<> int test<1>() { return -2; }; . . . In case it is unclear: libstdc++ is using such specializations that lead to the libstdc++ tied instances of such failures that was the basis for my original submittal. Technically libstdc++ could avoid such specializations as an implementation technique and avoid the problem for code using libstdc++ . If that happened, the tiny test would still not be covered and would become a separate issue. I'll also report that the tiny test also fails for clang++15 (from FreeBSD's devel/llvm15 port) but libc++ does not have the problem for the original example I submitted here. So, apparently, libc++ avoids use of template specializations in its implementation of the specific original example.