https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99528
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathan Sidwell <nat...@gcc.gnu.org>: https://gcc.gnu.org/g:edc61d34eb4212d5547e9f628b5f7f4d15ee0060 commit r11-7626-gedc61d34eb4212d5547e9f628b5f7f4d15ee0060 Author: Nathan Sidwell <nat...@acm.org> Date: Thu Mar 11 05:39:11 2021 -0800 c++: template partial instantiation mismatch [PR 99528] This turned out to be an existing problem, which had been hidden by other bugs. Templated members of templated classes can end up instantiating the template itself, and we were not handling the mergeableness of that correctly. PR c++/99528 gcc/cp/ * module.cc (enum merge_kind): Delete MK_type_tmpl_spec, MK_decl_tmpl_spec. (trees_in::decl_value): Adjust add_mergeable_specialization call. (trees_out::get_merge_kind): Adjust detecting a partial template instantiation. (trees_out::key_mergeable): Adjust handling same. (trees_in::key_mergeabvle): Likewise. gcc/testsuite/ * g++.dg/modules/pr99528.h: New. * g++.dg/modules/pr99528_a.H: New. * g++.dg/modules/pr99528_b.H: New. * g++.dg/modules/pr99528_c.C: New.